diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index c02a208f4ede..01d8c318d2f0 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -2372,8 +2372,6 @@ __decay_copy(const _Tp& __t) #endif -#ifndef _LIBCPP_HAS_NO_VARIADICS - template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> { @@ -2570,265 +2568,6 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatil #endif // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC) -#else // _LIBCPP_HAS_NO_VARIADICS - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(...), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...), true, false> -{ - typedef _Class _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const, true, false> -{ - typedef _Class const _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(...) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) volatile, true, false> -{ - typedef _Class volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, ...); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2); -}; - -template -struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const volatile, true, false> -{ - typedef _Class const volatile _ClassType; - typedef _Rp _ReturnType; - typedef _Rp (_FnType) (_P0, _P1, _P2, ...); -}; - -#endif // _LIBCPP_HAS_NO_VARIADICS template struct __member_pointer_traits_imp<_Rp _Class::*, false, true> @@ -3143,7 +2882,7 @@ struct _LIBCPP_TEMPLATE_VIS is_constructible : public __libcpp_is_constructible<_Tp, _Args...>::type {}; #endif -#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_constructible_v = is_constructible<_Tp, _Args...>::value; @@ -3194,8 +2933,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_constructible_v // is_trivially_constructible -#ifndef _LIBCPP_HAS_NO_VARIADICS - #if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501 template @@ -3246,80 +2983,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&> #endif // !__has_feature(is_trivially_constructible) -#else // _LIBCPP_HAS_NO_VARIADICS -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible - : false_type -{ -}; - -#if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501 - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, - __is_construct::__nat> - : integral_constant -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp, - __is_construct::__nat> - : integral_constant -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&, - __is_construct::__nat> - : integral_constant -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&, - __is_construct::__nat> - : integral_constant -{ -}; - -#else // !__has_feature(is_trivially_constructible) - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, - __is_construct::__nat> - : integral_constant::value> -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp, - __is_construct::__nat> - : integral_constant::value> -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&, - __is_construct::__nat> - : integral_constant::value> -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&, - __is_construct::__nat> - : integral_constant::value> -{ -}; - -#endif // !__has_feature(is_trivially_constructible) - -#endif // _LIBCPP_HAS_NO_VARIADICS - -#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_constructible_v = is_trivially_constructible<_Tp, _Args...>::value; @@ -3472,8 +3137,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_destructible_v // is_nothrow_constructible -#ifndef _LIBCPP_HAS_NO_VARIADICS - #if __has_keyword(__is_nothrow_constructible) template @@ -3571,80 +3234,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&> #endif // _LIBCPP_HAS_NO_NOEXCEPT -#else // _LIBCPP_HAS_NO_VARIADICS -#if __has_keyword(__is_nothrow_constructible) - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible - : public integral_constant {}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _A0> - : public integral_constant {}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp> - : public integral_constant {}; - -#else // __has_keyword(__is_nothrow_constructible) - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible - : false_type -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat, - __is_construct::__nat> -#if __has_feature(has_nothrow_constructor) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant -#else - : integral_constant::value> -#endif -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp, - __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant -#else - : integral_constant::value> -#endif -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&, - __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant -#else - : integral_constant::value> -#endif -{ -}; - -template -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&, - __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant -#else - : integral_constant::value> -#endif -{ -}; - -#endif // __has_keyword(__is_nothrow_constructible) -#endif // _LIBCPP_HAS_NO_VARIADICS - -#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value; @@ -4524,7 +4115,6 @@ struct __has_operator_addressof template using void_t = void; -# ifndef _LIBCPP_HAS_NO_VARIADICS template struct conjunction : __and_<_Args...> {}; template @@ -4542,7 +4132,6 @@ struct negation : __not_<_Tp> {}; template _LIBCPP_INLINE_VAR constexpr bool negation_v = negation<_Tp>::value; -# endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_STD_VER > 14 // These traits are used in __tree and __hash_table