[libcxx-commits] [PATCH] D124755: [libc++] Granularize parts of <type_traits>

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 18 13:01:49 PDT 2022


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

The direction LGTM, but I'd like to see the final form with passing CI before shipping this.



================
Comment at: libcxx/include/cstddef:64-66
 template <bool> struct __enable_if_integral_imp {};
 template <> struct __enable_if_integral_imp<true> { using type = byte; };
 template <class _Tp> using _EnableByteOverload = typename __enable_if_integral_imp<__libcpp_is_integral<_Tp>::value>::type;
----------------
I suspect this was used instead of `std::enable_if<std::is_integral<T>>` because of circular header dependency issues. I don't think we have those issues anymore, so we could use the simpler form instead and get rid of `__libcpp_is_integral` altogether. This assumes that all the compilers we support implement the `__is_integral` builtin, which is probably true.

I suggest doing that cleanup as a separate patch. Even if we can't remove `__libcpp_is_integral` in the end, it would still be good to use `__enable_if` instead of `__enable_if_integral_imp` here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124755



More information about the libcxx-commits mailing list