diff --git a/libcxx/include/__type_traits/enable_if.h b/libcxx/include/__type_traits/enable_if.h --- a/libcxx/include/__type_traits/enable_if.h +++ b/libcxx/include/__type_traits/enable_if.h @@ -10,7 +10,6 @@ #define _LIBCPP___TYPE_TRAITS_ENABLE_IF_H #include <__config> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -35,6 +35,8 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> +#include <__type_traits/enable_if.h> +#include <__type_traits/integral_constant.h> #include <__type_traits/is_integral.h> #include #include @@ -60,11 +62,6 @@ { enum class byte : unsigned char {}; - -template struct __enable_if_integral_imp {}; -template <> struct __enable_if_integral_imp { using type = byte; }; -template using _EnableByteOverload = typename __enable_if_integral_imp<__libcpp_is_integral<_Tp>::value>::type; - constexpr byte operator| (byte __lhs, byte __rhs) noexcept { return static_cast( @@ -105,6 +102,10 @@ ~static_cast(__b) )); } + +template +using _EnableByteOverload = __enable_if_t::value, byte>; + template constexpr _EnableByteOverload<_Integer> & operator<<=(byte& __lhs, _Integer __shift) noexcept