diff options
Diffstat (limited to 'compat/util.hpp')
-rw-r--r-- | compat/util.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compat/util.hpp b/compat/util.hpp index c0d3e3fd..41c8def9 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -8,6 +8,7 @@ #include "macros.hpp" #include "value-templates.hpp" +#include <type_traits> #include <memory> #include <cmath> #include <utility> @@ -80,3 +81,8 @@ inline auto clamp(const t& val, const u& min, const w& max) using tp = decltype(val + min + max); return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max); } + +template<typename t> +using cv_qualified = std::conditional_t<is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>; + + |