diff --git a/BAN/include/BAN/Traits.h b/BAN/include/BAN/Traits.h index d9690ee5..c72704dd 100644 --- a/BAN/include/BAN/Traits.h +++ b/BAN/include/BAN/Traits.h @@ -94,9 +94,17 @@ namespace BAN { template> struct is_signed { static constexpr bool value = T(-1) < T(0); }; template struct is_signed : false_type {}; + + template> struct is_unsigned { static constexpr bool value = T(0) < T(-1); }; + template struct is_unsigned : false_type {}; } template struct is_signed : detail::is_signed {}; template inline constexpr bool is_signed_v = is_signed::value; + template concept signed_integral = is_signed_v && is_integral_v; + + template struct is_unsigned : detail::is_unsigned {}; + template inline constexpr bool is_unsigned_v = is_unsigned::value; + template concept unsigned_integral = is_unsigned_v && is_integral_v; 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; } };