diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -476,8 +476,6 @@ using _EnableIfImpl _LIBCPP_NODEBUG_TYPE = _Tp; template using _OrImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value != true && sizeof...(_Rest) != 0>::template _OrImpl<_First, _Rest...>; - template - using _AndImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value == true && sizeof...(_Rest) != 0>::template _AndImpl<_First, _Rest...>; }; template <> @@ -488,8 +486,6 @@ using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _SecondFn<_Args...>; template using _OrImpl _LIBCPP_NODEBUG_TYPE = _Result; - template - using _AndImpl _LIBCPP_NODEBUG_TYPE = _Result; }; template using _EnableIf _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _EnableIfImpl<_Ret>; @@ -497,8 +493,6 @@ using _If _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>; template using _Or _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl; -template -using _And _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _AndImpl; template struct _Not : _BoolConstant {}; template @@ -506,6 +500,14 @@ template using _SecondType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>; +template using __expand_to_true = true_type; +template +__expand_to_true<_EnableIf<_Pred::value>...> __and_helper(int); +template +false_type __and_helper(...); +template +using _And _LIBCPP_NODEBUG_TYPE = decltype(__and_helper<_Pred...>(0)); + template