[libcxx-commits] [PATCH] D102328: [libc++] Fix constraint for [bit.pow.two] functions

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 12 07:49:24 PDT 2021


Quuxplusone requested changes to this revision.
Quuxplusone added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/include/bit:89
         _IsNotSame<typename remove_cv<_Tp>::type, char16_t>::value &&
         _IsNotSame<typename remove_cv<_Tp>::type, char32_t>::value
     >;
----------------
Seems like we should add `char8_t` while we're here, yeah? (It is also integral and unsigned but not an unsigned integer type.)  For bonus clarity, we could make a type trait `__is_integer_type<_Tp>` and then this whole constraint on line 97 would be simply
```
static_assert(__is_integer_type<_Tp>::value && is_unsigned<_Tp>::value, "__rotl requires an unsigned integer type");
```
...except that a static_assert is not a "constraint," so we're just totally nonconforming here.
@jwakely, thoughts? I'd volunteer to commandeer if you like.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102328



More information about the libcxx-commits mailing list