diff --git a/cast.hpp b/cast.hpp index 37e6d58b..ed4fbb98 100644 --- a/cast.hpp +++ b/cast.hpp @@ -8,6 +8,8 @@ #pragma once + +#include "concepts.hpp" #include "debug/assert.hpp" #include "debug/validate.hpp" #include "platform.hpp" @@ -72,17 +74,13 @@ namespace cruft::cast { /// Identity casts are allowed so as to simplify the use of this routine /// in template code. template < - typename NarrowT, - typename WideT, - typename = std::enable_if_t< - std::is_arithmetic_v && - std::is_arithmetic_v && - std::is_signed_v == std::is_signed_v && - std::is_floating_point_v == std::is_floating_point_v && - sizeof (NarrowT) <= sizeof (WideT), - void - > + concepts::arithmetic NarrowT, + concepts::arithmetic WideT > + requires + (std::is_signed_v == std::is_signed_v) && + (std::is_floating_point_v == std::is_floating_point_v) && + (sizeof (NarrowT) <= sizeof (WideT)) constexpr NarrowT narrow (const WideT &val) {