diff --git a/BAN/include/BAN/Traits.h b/BAN/include/BAN/Traits.h index 0a9ca4f3b6..f9cef34356 100644 --- a/BAN/include/BAN/Traits.h +++ b/BAN/include/BAN/Traits.h @@ -65,6 +65,16 @@ namespace BAN template struct is_const : true_type {}; template inline constexpr bool is_const_v = is_const::value; + template struct is_arithmetic { static constexpr bool value = is_integral_v || is_floating_point_v; }; + template inline constexpr bool is_arithmetic_v = is_arithmetic::value; + + namespace detail + { + template> struct is_signed { static constexpr bool value = T(-1) < T(0); }; + template struct is_signed : false_type {}; + } + template struct is_signed : detail::is_signed {}; + template inline constexpr bool is_signed_v = is_signed::value; template struct less { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs < rhs; } }; template struct equal { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs == rhs; } };