-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
enhancementSomething can be improvedSomething can be improvedfixedSomething works now, yay!Something works now, yay!
Description
- Clang has implemented the
__is_scoped_enumintrinsic since Clang 16 (llvm/llvm-project@a089def, LLVM-D135177). But MSVC and EDG don't seem to have it implemented. Should we use__is_scoped_enumfor Clang, which possibly improve throughput? - As noticed in
<type_traits>: Implementis_scoped_enum#1950, MSVC thinks that an unscoped enumeration type without fixed underlying type is complete in its enumerator-list (and generally treatsintas its underlying type). This is non-conforming, while a conformance fix is likely to break the current implementation strategy. I think I've found the strategy (see below) working with both conforming and non-conforming treatments. Should we use it or something similar?
void _Test_convertibility_for_is_scoped_enum(...); // not defined
void _Test_convertibility_for_is_scoped_enum(int) = delete;
template <class _Ty>
concept _Is_scoped_enum_impl = __is_enum(_Ty) && requires { _STD _Test_convertibility_for_is_scoped_enum(_Ty{}); };
_EXPORT_STD template <class _Ty>
struct is_scoped_enum : bool_constant<_Is_scoped_enum_impl<_Ty>> {};
_EXPORT_STD template <class _Ty>
constexpr bool is_scoped_enum_v = _Is_scoped_enum_impl<_Ty>;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementSomething can be improvedSomething can be improvedfixedSomething works now, yay!Something works now, yay!