diff --git a/types/traits.hpp b/types/traits.hpp index 45e48c2a..b64f875f 100644 --- a/types/traits.hpp +++ b/types/traits.hpp @@ -120,6 +120,20 @@ template using try_signed_t = typename try_signed::type; +/////////////////////////////////////////////////////////////////////////////// +namespace cruft { + template + struct try_underlying { using type = ValueT; }; + + + template + struct try_underlying< + ValueT, + std::void_t> + > { using type = std::underlying_type; }; +} + + /////////////////////////////////////////////////////////////////////////////// /// checks if a type can be converted in all cases without modification template struct is_lossless_cast : std::enable_if<