summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-24 07:25:29 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-24 07:25:29 +0100
commit6905b3c68d1bcca661295f3d43fc4d75494065a9 (patch)
tree10c0a59d025212a48f7f4d4c72b547cef362be82
parent87c89034894eae06c68e261f5a48c36b8f676b0d (diff)
wip
-rw-r--r--entity/erased-constraints.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/entity/erased-constraints.cpp b/entity/erased-constraints.cpp
index 6b56b837..2ac049d5 100644
--- a/entity/erased-constraints.cpp
+++ b/entity/erased-constraints.cpp
@@ -18,7 +18,19 @@ template<typename T> std::pair<T, T> range::convert() const
static_assert(sizeof(T) <= sizeof(min));
if (type == type_none)
- return { std::numeric_limits<T>::min(), std::numeric_limits<T>::max() };
+ {
+ if constexpr (is_magnum_vector<T>)
+ {
+ using U = typename T::Type;
+ constexpr auto Size = T::Size;
+ T a, b;
+ for (std::size_t i = 0; i < Size; i++)
+ a[i] = std::numeric_limits<U>::min(), b[i] = std::numeric_limits<U>::max();
+ return {a, b};
+ }
+ else
+ return { std::numeric_limits<T>::min(), std::numeric_limits<T>::max() };
+ }
else
{
if constexpr (std::is_integral_v<T>)