diff options
Diffstat (limited to 'options/value-traits.hpp')
-rw-r--r-- | options/value-traits.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/options/value-traits.hpp b/options/value-traits.hpp index 145cd924..e676f942 100644 --- a/options/value-traits.hpp +++ b/options/value-traits.hpp @@ -15,6 +15,17 @@ using cv_qualified = std::remove_cvref_t<t>, std::add_lvalue_reference_t<std::add_const_t<std::remove_cvref_t<t>>>>; +template<typename t, typename = void> +struct maybe_enum_type { + using type = t; +}; +template<typename t> +struct maybe_enum_type<t, std::enable_if_t<std::is_enum_v<t>>> { + using type = int; +}; + +template<typename t> using maybe_enum_type_t = typename maybe_enum_type<t>::type; + template<typename t, typename u = t, typename Enable = void> struct default_value_traits { |