"vscode:/vscode.git/clone" did not exist on "c54a07df2f5d9fcf099b513476f178ff4f06d345"
Commit a740f253 authored by Paul's avatar Paul
Browse files

Formatting

parent 1b18e9d0
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
namespace rtg { namespace rtg {
#define RTG_REQUIRES(...) class=typename std::enable_if<(__VA_ARGS__)>::type #define RTG_REQUIRES(...) class = typename std::enable_if<(__VA_ARGS__)>::type
struct raw_data_base struct raw_data_base
{}; {
};
/** /**
* @brief Provides a base class for common operations with raw buffer * @brief Provides a base class for common operations with raw buffer
...@@ -98,7 +99,10 @@ struct raw_data : raw_data_base ...@@ -98,7 +99,10 @@ struct raw_data : raw_data_base
auto_cast get() const { return {static_cast<const Derived*>(this)}; } auto_cast get() const { return {static_cast<const Derived*>(this)}; }
}; };
template<class T, class U, RTG_REQUIRES(std::is_base_of<raw_data_base, T>{}), RTG_REQUIRES(std::is_base_of<raw_data_base, U>{})> template <class T,
class U,
RTG_REQUIRES(std::is_base_of<raw_data_base, T>{}),
RTG_REQUIRES(std::is_base_of<raw_data_base, U>{})>
bool operator==(const T& x, const U& y) bool operator==(const T& x, const U& y)
{ {
auto&& xshape = x.get_shape(); auto&& xshape = x.get_shape();
...@@ -118,7 +122,10 @@ bool operator==(const T& x, const U& y) ...@@ -118,7 +122,10 @@ bool operator==(const T& x, const U& y)
return result; return result;
} }
template<class T, class U, RTG_REQUIRES(std::is_base_of<raw_data_base, T>{}), RTG_REQUIRES(std::is_base_of<raw_data_base, U>{})> template <class T,
class U,
RTG_REQUIRES(std::is_base_of<raw_data_base, T>{}),
RTG_REQUIRES(std::is_base_of<raw_data_base, U>{})>
bool operator!=(const T& x, const U& y) bool operator!=(const T& x, const U& y)
{ {
return !(x == y); return !(x == y);
......
...@@ -121,7 +121,7 @@ struct tensor_view ...@@ -121,7 +121,7 @@ struct tensor_view
shape m_shape; shape m_shape;
}; };
template<class T, class U> template <class T, class U>
bool operator==(const tensor_view<T>& x, const tensor_view<U>& y) bool operator==(const tensor_view<T>& x, const tensor_view<U>& y)
{ {
if(x.get_shape() == y.get_shape()) if(x.get_shape() == y.get_shape())
...@@ -136,8 +136,11 @@ bool operator==(const tensor_view<T>& x, const tensor_view<U>& y) ...@@ -136,8 +136,11 @@ bool operator==(const tensor_view<T>& x, const tensor_view<U>& y)
return false; return false;
} }
template<class T, class U> template <class T, class U>
bool operator!=(const tensor_view<T>& x, const tensor_view<U>& y) { return !(x == y); } bool operator!=(const tensor_view<T>& x, const tensor_view<U>& y)
{
return !(x == y);
}
template <class T> template <class T>
tensor_view<T> make_view(shape s, T* data) tensor_view<T> make_view(shape s, T* data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment