diff options
Diffstat (limited to 'entity')
| -rw-r--r-- | entity/constraints.hpp | 7 | ||||
| -rw-r--r-- | entity/erased-constraints.cpp | 12 | ||||
| -rw-r--r-- | entity/erased-constraints.hpp | 3 |
3 files changed, 11 insertions, 11 deletions
diff --git a/entity/constraints.hpp b/entity/constraints.hpp index 6a5587d5..0bfc2f15 100644 --- a/entity/constraints.hpp +++ b/entity/constraints.hpp @@ -1,8 +1,7 @@ #pragma once #include "compat/limits.hpp" #include "erased-constraints.hpp" -#include <type_traits> -#include <utility> +#include <cr/Pair.h> #include <mg/Vector.h> namespace floormat::entities::limit_detail { @@ -52,7 +51,7 @@ template<typename T> struct range T max = limit_detail::limit_traits<T>::max(); constexpr operator erased_constraints::range() const noexcept; - constexpr operator std::pair<T, T>() const noexcept; + constexpr operator Pair<T, T>() const noexcept; constexpr bool operator==(const range&) const noexcept = default; }; @@ -125,7 +124,7 @@ template<typename T> constexpr range<T>::operator erased_constraints::range() const noexcept { return erased_range_from_range(min, max); } -template<typename T> constexpr range<T>::operator std::pair<T, T>() const noexcept { return { min, max }; } +template<typename T> constexpr range<T>::operator Pair<T, T>() const noexcept { return { min, max }; } template<> struct range<String> { constexpr operator erased_constraints::range() const noexcept { return {}; } }; template<> struct range<StringView> { constexpr operator erased_constraints::range() const noexcept { return {}; } }; diff --git a/entity/erased-constraints.cpp b/entity/erased-constraints.cpp index 6e81820a..4cb915dc 100644 --- a/entity/erased-constraints.cpp +++ b/entity/erased-constraints.cpp @@ -2,17 +2,17 @@ #include "compat/assert.hpp" #include <cmath> #include <limits> -#include <Magnum/Magnum.h> -#include <Magnum/Math/Vector2.h> -#include <Magnum/Math/Vector3.h> -#include <Magnum/Math/Vector4.h> +#include <cr/Pair.h> +#include <mg/Vector2.h> +#include <mg/Vector3.h> +#include <mg/Vector4.h> namespace floormat::entities::erased_constraints { static_assert(sizeof(size_t) == sizeof(uintptr_t)); static_assert(sizeof(size_t) == sizeof(ptrdiff_t)); -template<typename T> std::pair<T, T> range::convert() const +template<typename T> Pair<T, T> range::convert() const { static_assert(sizeof(T) <= sizeof(min)); @@ -103,7 +103,7 @@ template<typename T> std::pair<T, T> range::convert() const } } -template<typename T> using pair2 = std::pair<T, T>; +template<typename T> using pair2 = Pair<T, T>; template pair2<uint8_t> range::convert() const; template pair2<uint16_t> range::convert() const; diff --git a/entity/erased-constraints.hpp b/entity/erased-constraints.hpp index af050bd6..64b469a3 100644 --- a/entity/erased-constraints.hpp +++ b/entity/erased-constraints.hpp @@ -1,4 +1,5 @@ #pragma once +#include <utility> #include <Corrade/Containers/StringView.h> #include <Magnum/Math/Vector4.h> @@ -25,7 +26,7 @@ struct range final element min, max; type_ type = type_none; - template<typename T> std::pair<T, T> convert() const; + template<typename T> Pair<T, T> convert() const; friend bool operator==(const range& a, const range& b); }; |
