Commit a740f253 authored by Paul's avatar Paul
Browse files

Formatting

parent 1b18e9d0
......@@ -6,10 +6,11 @@
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
{};
{
};
/**
* @brief Provides a base class for common operations with raw buffer
......@@ -98,7 +99,10 @@ struct raw_data : raw_data_base
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)
{
auto&& xshape = x.get_shape();
......@@ -118,7 +122,10 @@ bool operator==(const T& x, const U& y)
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)
{
return !(x == y);
......
......@@ -121,7 +121,7 @@ struct tensor_view
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)
{
if(x.get_shape() == y.get_shape())
......@@ -136,8 +136,11 @@ bool operator==(const tensor_view<T>& x, const tensor_view<U>& y)
return false;
}
template<class T, class U>
bool operator!=(const tensor_view<T>& x, const tensor_view<U>& y) { return !(x == y); }
template <class T, class U>
bool operator!=(const tensor_view<T>& x, const tensor_view<U>& y)
{
return !(x == y);
}
template <class T>
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