File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,9 @@ constexpr auto is_specialization_of()
114114
115115template <typename E>
116116constexpr bool is_scoped_enum_v =
117- std::is_enum_v<E> and
118- not std::is_convertible_v<E, std::underlying_type_t <E>>;
117+ std::is_enum_v<E> and not std::is_convertible_v<E, underlying_type_t <E>>;
118+ template <typename E>
119+ using is_scoped_enum = std::bool_constant<is_scoped_enum_v<E>>;
119120
120121template <typename ...> struct type_list {};
121122template <auto ...> struct value_list {};
Original file line number Diff line number Diff line change @@ -77,8 +77,13 @@ enum struct E2 {};
7777} // namespace
7878
7979TEST_CASE (" is_scoped_enum" , " [type_traits]" ) {
80+ static_assert (not stdx::is_scoped_enum_v<int >);
8081 static_assert (not stdx::is_scoped_enum_v<E1 >);
8182 static_assert (stdx::is_scoped_enum_v<E2 >);
83+
84+ static_assert (not stdx::is_scoped_enum<int >::value);
85+ static_assert (not stdx::is_scoped_enum<E1 >::value);
86+ static_assert (stdx::is_scoped_enum<E2 >::value);
8287}
8388
8489TEST_CASE (" type_identity" , " [type_traits]" ) {
You can’t perform that action at this time.
0 commit comments