[libcxx-commits] [PATCH] D97283: [libcxx][type_traits] is_unsigned is false for enum types

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 23 07:18:25 PST 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/type_traits:1461
+                                                          !__is_enum(_Tp);
 #endif
 
----------------
Quuxplusone wrote:
> FWIW, I would prefer to hew closer to the actual standardese in https://eel.is/c++draft/meta#tab:meta.unary.prop and just use `__is_unsigned(_Tp) && is_arithmetic<_Tp>::value`.
> 
> It's also definitely worth opening a discussion with compiler vendors — it'd be great if every compiler's `__is_enum` builtin were updated to reflect the standard semantics, since that is literally the entire point of that builtin. :P
> 
(oops, of course I meant `s/__is_enum/__is_{un,}signed/` in my second paragraph)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97283/new/

https://reviews.llvm.org/D97283



More information about the libcxx-commits mailing list