Commit a7dcd9fb authored by Paul's avatar Paul
Browse files

Formatting

parent aaf4fcc6
...@@ -90,19 +90,19 @@ struct raw_data : raw_data_base ...@@ -90,19 +90,19 @@ struct raw_data : raw_data_base
return self->template at<T>(); return self->template at<T>();
} }
template<class T> template <class T>
using is_data_ptr = bool_c<(std::is_void<T>{} or std::is_same<char, std::remove_cv_t<T>>{} or std::is_same<unsigned char, std::remove_cv_t<T>>{})>; using is_data_ptr =
bool_c<(std::is_void<T>{} or std::is_same<char, std::remove_cv_t<T>>{} or
std::is_same<unsigned char, std::remove_cv_t<T>>{})>;
template<class T> template <class T>
using get_data_type = std::conditional_t<is_data_ptr<T>{}, using get_data_type = std::conditional_t<is_data_ptr<T>{}, float, T>;
float,
T
>;
template<class T> template <class T>
bool matches() const bool matches() const
{ {
return is_data_ptr<T>{} || self->get_shape().type() == rtg::shape::get_type<get_data_type<T>>{}; return is_data_ptr<T>{} ||
self->get_shape().type() == rtg::shape::get_type<get_data_type<T>>{};
} }
template <class T> template <class T>
......
...@@ -10,13 +10,15 @@ struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>> // NOLINT ...@@ -10,13 +10,15 @@ struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>> // NOLINT
{ {
}; };
template<bool B> template <bool B>
using bool_c = std::integral_constant<bool, B>; using bool_c = std::integral_constant<bool, B>;
#ifdef CPPCHECK #ifdef CPPCHECK
#define RTG_REQUIRES(...) class = void #define RTG_REQUIRES(...) class = void
#else #else
#define RTG_REQUIRES(...) bool PrivateRequires ## __LINE__ = true, class = typename std::enable_if<and_<__VA_ARGS__, PrivateRequires ## __LINE__>{}>::type #define RTG_REQUIRES(...) \
bool PrivateRequires##__LINE__ = true, \
class = typename std::enable_if<and_<__VA_ARGS__, PrivateRequires##__LINE__>{}>::type
#endif #endif
} // namespace rtg } // namespace rtg
......
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