diff --git a/libcxx/include/exception b/libcxx/include/exception --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -300,10 +300,10 @@ } template -struct __can_dynamic_cast : public _LIBCPP_BOOL_CONSTANT( +struct __can_dynamic_cast : _BoolConstant< is_polymorphic<_From>::value && (!is_base_of<_To, _From>::value || - is_convertible::value)) {}; + is_convertible::value)> {}; template inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/ratio b/libcxx/include/ratio --- a/libcxx/include/ratio +++ b/libcxx/include/ratio @@ -416,11 +416,11 @@ template struct _LIBCPP_TEMPLATE_VIS ratio_equal - : public _LIBCPP_BOOL_CONSTANT((_R1::num == _R2::num && _R1::den == _R2::den)) {}; + : _BoolConstant<(_R1::num == _R2::num && _R1::den == _R2::den)> {}; template struct _LIBCPP_TEMPLATE_VIS ratio_not_equal - : public _LIBCPP_BOOL_CONSTANT((!ratio_equal<_R1, _R2>::value)) {}; + : _BoolConstant::value> {}; // ratio_less @@ -479,19 +479,19 @@ template struct _LIBCPP_TEMPLATE_VIS ratio_less - : public _LIBCPP_BOOL_CONSTANT((__ratio_less<_R1, _R2>::value)) {}; + : _BoolConstant<__ratio_less<_R1, _R2>::value> {}; template struct _LIBCPP_TEMPLATE_VIS ratio_less_equal - : public _LIBCPP_BOOL_CONSTANT((!ratio_less<_R2, _R1>::value)) {}; + : _BoolConstant::value> {}; template struct _LIBCPP_TEMPLATE_VIS ratio_greater - : public _LIBCPP_BOOL_CONSTANT((ratio_less<_R2, _R1>::value)) {}; + : _BoolConstant::value> {}; template struct _LIBCPP_TEMPLATE_VIS ratio_greater_equal - : public _LIBCPP_BOOL_CONSTANT((!ratio_less<_R1, _R2>::value)) {}; + : _BoolConstant::value> {}; template struct __ratio_gcd diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -450,9 +450,6 @@ #if _LIBCPP_STD_VER > 14 template using bool_constant = integral_constant; -#define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)> -#else -#define _LIBCPP_BOOL_CONSTANT(__b) integral_constant #endif template struct _LIBCPP_TEMPLATE_VIS enable_if {}; @@ -464,8 +461,8 @@ template using enable_if_t = typename enable_if<_Bp, _Tp>::type; #endif -typedef _LIBCPP_BOOL_CONSTANT(true) true_type; -typedef _LIBCPP_BOOL_CONSTANT(false) false_type; +typedef integral_constant true_type; +typedef integral_constant false_type; template using _BoolConstant _LIBCPP_NODEBUG = integral_constant; @@ -1354,7 +1351,7 @@ #else // __has_keyword(__is_signed) template ::value> -struct __libcpp_is_signed_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(-1) < _Tp(0)) {}; +struct __libcpp_is_signed_impl : public _BoolConstant<(_Tp(-1) < _Tp(0))> {}; template struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; // floating point @@ -1392,7 +1389,7 @@ #else // __has_keyword(__is_unsigned) template ::value> -struct __libcpp_is_unsigned_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(0) < _Tp(-1)) {}; +struct __libcpp_is_unsigned_impl : public _BoolConstant<(_Tp(0) < _Tp(-1))> {}; template struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {}; // floating point