summaryrefslogtreecommitdiffhomepage
path: root/entity
diff options
context:
space:
mode:
Diffstat (limited to 'entity')
-rw-r--r--entity/constraints.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/entity/constraints.hpp b/entity/constraints.hpp
index c807fddc..6a5587d5 100644
--- a/entity/constraints.hpp
+++ b/entity/constraints.hpp
@@ -26,6 +26,14 @@ struct limit_traits<T>
};
template<typename T>
+requires std::is_enum_v<T>
+struct limit_traits<T>
+{
+ static constexpr T min() { return T(limits<std::underlying_type_t<T>>::min); }
+ static constexpr T max() { return T(limits<std::underlying_type_t<T>>::max); }
+};
+
+template<typename T>
struct limit_traits
{
static_assert(std::is_nothrow_default_constructible_v<T>);