diff options
Diffstat (limited to 'entity/constraints.hpp')
-rw-r--r-- | entity/constraints.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/entity/constraints.hpp b/entity/constraints.hpp index 171c555a..bc991dfc 100644 --- a/entity/constraints.hpp +++ b/entity/constraints.hpp @@ -13,11 +13,12 @@ template<typename T> struct range using limits = std::numeric_limits<T>; T min = limits::min(), max = limits::max(); - constexpr operator erased_constraints::range() const; + constexpr operator erased_constraints::range() const noexcept; + constexpr operator std::pair<T, T>() const noexcept; }; template<typename T> -constexpr range<T>::operator erased_constraints::range() const +constexpr range<T>::operator erased_constraints::range() const noexcept { using enum erased_constraints::range::type_; if constexpr (std::is_floating_point_v<T>) @@ -29,6 +30,8 @@ constexpr range<T>::operator erased_constraints::range() const return { {}, {}, type_none }; } +template<typename T> constexpr range<T>::operator std::pair<T, T>() const noexcept { return { min, max }; } + using length = erased_constraints::length; using group = erased_constraints::group; |