diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h index 0d1ee4185c8c..9126caa9c7e9 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h @@ -1,33 +1,43 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H #define _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H #include <__config> #include <__type_traits/is_referenceable.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_lvalue_reference) +template +struct add_lvalue_reference { + using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_lvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; }; template struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference {typedef _LIBCPP_NODEBUG typename __add_lvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_lvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h index aea2490c5d0c..be3f758da4af 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h @@ -1,41 +1,48 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_ADD_POINTER_H #define _LIBCPP___TYPE_TRAITS_ADD_POINTER_H #include <__config> #include <__type_traits/is_referenceable.h> #include <__type_traits/is_same.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__add_pointer) +template +struct add_pointer { + using type _LIBCPP_NODEBUG = __add_pointer(_Tp); +}; +#else template ::value || - _IsSame::type, void>::value> -struct __add_pointer_impl - {typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;}; + bool = __libcpp_is_referenceable<_Tp>::value || _IsSame::type, void>::value> +struct __add_pointer_impl { + typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type; +}; template struct __add_pointer_impl<_Tp, false> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS add_pointer {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_pointer) #if _LIBCPP_STD_VER > 11 template using add_pointer_t = typename add_pointer<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_ADD_POINTER_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h index b2a1428095d8..be01d4ec5ba8 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h @@ -1,33 +1,43 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H #define _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H #include <__config> #include <__type_traits/is_referenceable.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_rvalue_reference) +template +struct add_rvalue_reference { + using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_rvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; }; template struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference {typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_rvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/decay.h b/contrib/llvm-project/libcxx/include/__type_traits/decay.h index 2af0c1ca42c3..ced21d81c815 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/decay.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/decay.h @@ -1,65 +1,72 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_DECAY_H #define _LIBCPP___TYPE_TRAITS_DECAY_H #include <__config> #include <__type_traits/add_pointer.h> #include <__type_traits/conditional.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_array.h> #include <__type_traits/is_function.h> #include <__type_traits/is_referenceable.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_extent.h> #include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__decay) +template +struct decay { + using type _LIBCPP_NODEBUG = __decay(_Tp); +}; +#else template struct __decay { typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type; }; template struct __decay<_Up, true> { public: typedef _LIBCPP_NODEBUG typename conditional < is_array<_Up>::value, typename add_pointer::type>::type, typename conditional < is_function<_Up>::value, typename add_pointer<_Up>::type, typename remove_cv<_Up>::type >::type >::type type; }; template struct _LIBCPP_TEMPLATE_VIS decay { private: typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; public: - typedef _LIBCPP_NODEBUG typename __decay<_Up, __is_referenceable<_Up>::value>::type type; + typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type; }; +#endif // __has_builtin(__decay) #if _LIBCPP_STD_VER > 11 template using decay_t = typename decay<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_DECAY_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h index b97631cc39dd..4b34ec257231 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h @@ -1,33 +1,41 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H #define _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H #include <__config> #include <__type_traits/integral_constant.h> #include <__type_traits/is_same.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD -struct __is_referenceable_impl { - template static _Tp& __test(int); - template static false_type __test(...); +#if __has_builtin(__is_referenceable) +template +struct __libcpp_is_referenceable : integral_constant {}; +#else +struct __libcpp_is_referenceable_impl { + template + static _Tp& __test(int); + template + static false_type __test(...); }; template -struct __is_referenceable : integral_constant(0)), false_type>::value> {}; +struct __libcpp_is_referenceable + : integral_constant(0)), false_type>::value> { +}; +#endif // __has_builtin(__is_referenceable) _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h index fbc31172a978..c36e2292f16f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h @@ -1,76 +1,83 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H #define _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H #include <__config> #include <__type_traits/apply_cv.h> #include <__type_traits/is_enum.h> #include <__type_traits/is_integral.h> #include <__type_traits/nat.h> #include <__type_traits/remove_cv.h> #include <__type_traits/type_list.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_signed) +template +struct make_signed { + using type _LIBCPP_NODEBUG = __make_signed(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __signed_types; template ::value || is_enum<_Tp>::value> struct __make_signed {}; template struct __make_signed<_Tp, true> { typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type; }; template <> struct __make_signed {}; template <> struct __make_signed< signed short, true> {typedef short type;}; template <> struct __make_signed {typedef short type;}; template <> struct __make_signed< signed int, true> {typedef int type;}; template <> struct __make_signed {typedef int type;}; template <> struct __make_signed< signed long, true> {typedef long type;}; template <> struct __make_signed {typedef long type;}; template <> struct __make_signed< signed long long, true> {typedef long long type;}; template <> struct __make_signed {typedef long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;}; template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_signed { typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; }; +#endif // __has_builtin(__make_signed) #if _LIBCPP_STD_VER > 11 template using make_signed_t = typename make_signed<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h index 8110a5ca9609..6d4e482a8d97 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h @@ -1,89 +1,96 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H #define _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H #include <__config> #include <__type_traits/apply_cv.h> #include <__type_traits/conditional.h> #include <__type_traits/is_enum.h> #include <__type_traits/is_integral.h> #include <__type_traits/is_unsigned.h> #include <__type_traits/nat.h> #include <__type_traits/remove_cv.h> #include <__type_traits/type_list.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_unsigned) +template +struct make_unsigned { + using type _LIBCPP_NODEBUG = __make_unsigned(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __unsigned_types; template ::value || is_enum<_Tp>::value> struct __make_unsigned {}; template struct __make_unsigned<_Tp, true> { typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type; }; template <> struct __make_unsigned {}; template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;}; template <> struct __make_unsigned {typedef unsigned short type;}; template <> struct __make_unsigned< signed int, true> {typedef unsigned int type;}; template <> struct __make_unsigned {typedef unsigned int type;}; template <> struct __make_unsigned< signed long, true> {typedef unsigned long type;}; template <> struct __make_unsigned {typedef unsigned long type;}; template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; template <> struct __make_unsigned {typedef unsigned long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;}; template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_unsigned { typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; }; +#endif // __has_builtin(__make_unsigned) #if _LIBCPP_STD_VER > 11 template using make_unsigned_t = typename make_unsigned<_Tp>::type; #endif #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_HIDE_FROM_ABI constexpr typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept { return static_cast::type>(__x); } #endif template using __copy_unsigned_t = __conditional_t::value, typename make_unsigned<_Up>::type, _Up>; _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h index 075e3acabb44..cc00a61c92b3 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h @@ -1,34 +1,41 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H #define _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H #include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_all_extents) +template +struct remove_all_extents { + using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_all_extents {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; +#endif // __has_builtin(__remove_all_extents) #if _LIBCPP_STD_VER > 11 template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h index 8efc893e965a..8eefbd099cb3 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h @@ -1,28 +1,36 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H #define _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_const) +template +struct remove_const { + using type _LIBCPP_NODEBUG = __remove_const(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; +#endif // __has_builtin(__remove_const) + #if _LIBCPP_STD_VER > 11 template using remove_const_t = typename remove_const<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h index ce1e4e45c6d1..9e3dee6c46ed 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h @@ -1,30 +1,38 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CV_H #define _LIBCPP___TYPE_TRAITS_REMOVE_CV_H #include <__config> #include <__type_traits/remove_const.h> #include <__type_traits/remove_volatile.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cv) +template +struct remove_cv { + using type _LIBCPP_NODEBUG = __remove_cv(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_cv {typedef typename remove_volatile::type>::type type;}; +#endif // __has_builtin(__remove_cv) + #if _LIBCPP_STD_VER > 11 template using remove_cv_t = typename remove_cv<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_CV_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h index d937501fedce..3af261db3949 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h @@ -1,41 +1,46 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H #define _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H #include <__config> #include <__type_traits/is_same.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cvref) +template +using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); +#else template using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv::type>::type; +#endif // __has_builtin(__remove_cvref) template struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {}; #if _LIBCPP_STD_VER > 17 // remove_cvref - same as __uncvref template struct remove_cvref { using type _LIBCPP_NODEBUG = __uncvref_t<_Tp>; }; template using remove_cvref_t = typename remove_cvref<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h index e353de361616..88da32a4e265 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h @@ -1,34 +1,41 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H #define _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H #include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_extent) +template +struct remove_extent { + using type _LIBCPP_NODEBUG = __remove_extent(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_extent {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]> {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]> {typedef _Tp type;}; +#endif // __has_builtin(__remove_extent) #if _LIBCPP_STD_VER > 11 template using remove_extent_t = typename remove_extent<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h index 50cde3829470..9042a5250055 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h @@ -1,32 +1,39 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H #define _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_pointer) +template +struct remove_pointer { + using type _LIBCPP_NODEBUG = __remove_pointer(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_pointer) #if _LIBCPP_STD_VER > 11 template using remove_pointer_t = typename remove_pointer<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h index a69e48dc584b..7ea7fa52ecc5 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h @@ -1,31 +1,38 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H #define _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H #include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_reference) +template +struct remove_reference { + using type _LIBCPP_NODEBUG = __remove_reference(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_reference) #if _LIBCPP_STD_VER > 11 template using remove_reference_t = typename remove_reference<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h index 79f64c46a27d..8c7aa6744193 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h @@ -1,28 +1,36 @@ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H #define _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_volatile) +template +struct remove_volatile { + using type _LIBCPP_NODEBUG = __remove_volatile(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; +#endif // __has_builtin(__remove_volatile) + #if _LIBCPP_STD_VER > 11 template using remove_volatile_t = typename remove_volatile<_Tp>::type; #endif _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H diff --git a/contrib/llvm-project/libcxx/include/type_traits b/contrib/llvm-project/libcxx/include/type_traits index 3a086c595f92..dc05f9a44daf 100644 --- a/contrib/llvm-project/libcxx/include/type_traits +++ b/contrib/llvm-project/libcxx/include/type_traits @@ -1,810 +1,810 @@ // -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_TYPE_TRAITS #define _LIBCPP_TYPE_TRAITS /* type_traits synopsis namespace std { // helper class: template struct integral_constant; typedef integral_constant true_type; // C++11 typedef integral_constant false_type; // C++11 template // C++14 using bool_constant = integral_constant; // C++14 typedef bool_constant true_type; // C++14 typedef bool_constant false_type; // C++14 // helper traits template struct enable_if; template struct conditional; // Primary classification traits: template struct is_void; template struct is_null_pointer; // C++14 template struct is_integral; template struct is_floating_point; template struct is_array; template struct is_pointer; template struct is_lvalue_reference; template struct is_rvalue_reference; template struct is_member_object_pointer; template struct is_member_function_pointer; template struct is_enum; template struct is_union; template struct is_class; template struct is_function; // Secondary classification traits: template struct is_reference; template struct is_arithmetic; template struct is_fundamental; template struct is_member_pointer; template struct is_scoped_enum; // C++2b template struct is_scalar; template struct is_object; template struct is_compound; // Const-volatile properties and transformations: template struct is_const; template struct is_volatile; template struct remove_const; template struct remove_volatile; template struct remove_cv; template struct add_const; template struct add_volatile; template struct add_cv; // Reference transformations: template struct remove_reference; template struct add_lvalue_reference; template struct add_rvalue_reference; // Pointer transformations: template struct remove_pointer; template struct add_pointer; template struct type_identity; // C++20 template using type_identity_t = typename type_identity::type; // C++20 // Integral properties: template struct is_signed; template struct is_unsigned; template struct make_signed; template struct make_unsigned; // Array properties and transformations: template struct rank; template struct extent; template struct remove_extent; template struct remove_all_extents; template struct is_bounded_array; // C++20 template struct is_unbounded_array; // C++20 // Member introspection: template struct is_pod; template struct is_trivial; template struct is_trivially_copyable; template struct is_standard_layout; template struct is_literal_type; // Deprecated in C++17; removed in C++20 template struct is_empty; template struct is_polymorphic; template struct is_abstract; template struct is_final; // C++14 template struct is_aggregate; // C++17 template struct is_constructible; template struct is_default_constructible; template struct is_copy_constructible; template struct is_move_constructible; template struct is_assignable; template struct is_copy_assignable; template struct is_move_assignable; template struct is_swappable_with; // C++17 template struct is_swappable; // C++17 template struct is_destructible; template struct is_trivially_constructible; template struct is_trivially_default_constructible; template struct is_trivially_copy_constructible; template struct is_trivially_move_constructible; template struct is_trivially_assignable; template struct is_trivially_copy_assignable; template struct is_trivially_move_assignable; template struct is_trivially_destructible; template struct is_nothrow_constructible; template struct is_nothrow_default_constructible; template struct is_nothrow_copy_constructible; template struct is_nothrow_move_constructible; template struct is_nothrow_assignable; template struct is_nothrow_copy_assignable; template struct is_nothrow_move_assignable; template struct is_nothrow_swappable_with; // C++17 template struct is_nothrow_swappable; // C++17 template struct is_nothrow_destructible; template struct has_virtual_destructor; template struct has_unique_object_representations; // C++17 // Relationships between types: template struct is_same; template struct is_base_of; template struct is_convertible; template struct is_nothrow_convertible; // C++20 template inline constexpr bool is_nothrow_convertible_v; // C++20 template struct is_invocable; template struct is_invocable_r; template struct is_nothrow_invocable; template struct is_nothrow_invocable_r; // Alignment properties and transformations: template struct alignment_of; template struct aligned_storage; template struct aligned_union; template struct remove_cvref; // C++20 template struct decay; template struct common_type; template struct underlying_type; template class result_of; // undefined; deprecated in C++17; removed in C++20 template class result_of; // deprecated in C++17; removed in C++20 template struct invoke_result; // C++17 // const-volatile modifications: template using remove_const_t = typename remove_const::type; // C++14 template using remove_volatile_t = typename remove_volatile::type; // C++14 template using remove_cv_t = typename remove_cv::type; // C++14 template using add_const_t = typename add_const::type; // C++14 template using add_volatile_t = typename add_volatile::type; // C++14 template using add_cv_t = typename add_cv::type; // C++14 // reference modifications: template using remove_reference_t = typename remove_reference::type; // C++14 template using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++14 template using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++14 // sign modifications: template using make_signed_t = typename make_signed::type; // C++14 template using make_unsigned_t = typename make_unsigned::type; // C++14 // array modifications: template using remove_extent_t = typename remove_extent::type; // C++14 template using remove_all_extents_t = typename remove_all_extents::type; // C++14 template inline constexpr bool is_bounded_array_v = is_bounded_array::value; // C++20 inline constexpr bool is_unbounded_array_v = is_unbounded_array::value; // C++20 // pointer modifications: template using remove_pointer_t = typename remove_pointer::type; // C++14 template using add_pointer_t = typename add_pointer::type; // C++14 // other transformations: template using aligned_storage_t = typename aligned_storage::type; // C++14 template using aligned_union_t = typename aligned_union::type; // C++14 template using remove_cvref_t = typename remove_cvref::type; // C++20 template using decay_t = typename decay::type; // C++14 template using enable_if_t = typename enable_if::type; // C++14 template using conditional_t = typename conditional::type; // C++14 template using common_type_t = typename common_type::type; // C++14 template using underlying_type_t = typename underlying_type::type; // C++14 template using result_of_t = typename result_of::type; // C++14; deprecated in C++17; removed in C++20 template using invoke_result_t = typename invoke_result::type; // C++17 template using void_t = void; // C++17 // See C++14 20.10.4.1, primary type categories template inline constexpr bool is_void_v = is_void::value; // C++17 template inline constexpr bool is_null_pointer_v = is_null_pointer::value; // C++17 template inline constexpr bool is_integral_v = is_integral::value; // C++17 template inline constexpr bool is_floating_point_v = is_floating_point::value; // C++17 template inline constexpr bool is_array_v = is_array::value; // C++17 template inline constexpr bool is_pointer_v = is_pointer::value; // C++17 template inline constexpr bool is_lvalue_reference_v = is_lvalue_reference::value; // C++17 template inline constexpr bool is_rvalue_reference_v = is_rvalue_reference::value; // C++17 template inline constexpr bool is_member_object_pointer_v = is_member_object_pointer::value; // C++17 template inline constexpr bool is_member_function_pointer_v = is_member_function_pointer::value; // C++17 template inline constexpr bool is_enum_v = is_enum::value; // C++17 template inline constexpr bool is_union_v = is_union::value; // C++17 template inline constexpr bool is_class_v = is_class::value; // C++17 template inline constexpr bool is_function_v = is_function::value; // C++17 // See C++14 20.10.4.2, composite type categories template inline constexpr bool is_reference_v = is_reference::value; // C++17 template inline constexpr bool is_arithmetic_v = is_arithmetic::value; // C++17 template inline constexpr bool is_fundamental_v = is_fundamental::value; // C++17 template inline constexpr bool is_object_v = is_object::value; // C++17 template inline constexpr bool is_scalar_v = is_scalar::value; // C++17 template inline constexpr bool is_compound_v = is_compound::value; // C++17 template inline constexpr bool is_member_pointer_v = is_member_pointer::value; // C++17 template inline constexpr bool is_scoped_enum_v = is_scoped_enum::value; // C++2b // See C++14 20.10.4.3, type properties template inline constexpr bool is_const_v = is_const::value; // C++17 template inline constexpr bool is_volatile_v = is_volatile::value; // C++17 template inline constexpr bool is_trivial_v = is_trivial::value; // C++17 template inline constexpr bool is_trivially_copyable_v = is_trivially_copyable::value; // C++17 template inline constexpr bool is_standard_layout_v = is_standard_layout::value; // C++17 template inline constexpr bool is_pod_v = is_pod::value; // C++17 template inline constexpr bool is_literal_type_v = is_literal_type::value; // C++17; deprecated in C++17; removed in C++20 template inline constexpr bool is_empty_v = is_empty::value; // C++17 template inline constexpr bool is_polymorphic_v = is_polymorphic::value; // C++17 template inline constexpr bool is_abstract_v = is_abstract::value; // C++17 template inline constexpr bool is_final_v = is_final::value; // C++17 template inline constexpr bool is_aggregate_v = is_aggregate::value; // C++17 template inline constexpr bool is_signed_v = is_signed::value; // C++17 template inline constexpr bool is_unsigned_v = is_unsigned::value; // C++17 template inline constexpr bool is_constructible_v = is_constructible::value; // C++17 template inline constexpr bool is_default_constructible_v = is_default_constructible::value; // C++17 template inline constexpr bool is_copy_constructible_v = is_copy_constructible::value; // C++17 template inline constexpr bool is_move_constructible_v = is_move_constructible::value; // C++17 template inline constexpr bool is_assignable_v = is_assignable::value; // C++17 template inline constexpr bool is_copy_assignable_v = is_copy_assignable::value; // C++17 template inline constexpr bool is_move_assignable_v = is_move_assignable::value; // C++17 template inline constexpr bool is_swappable_with_v = is_swappable_with::value; // C++17 template inline constexpr bool is_swappable_v = is_swappable::value; // C++17 template inline constexpr bool is_destructible_v = is_destructible::value; // C++17 template inline constexpr bool is_trivially_constructible_v = is_trivially_constructible::value; // C++17 template inline constexpr bool is_trivially_default_constructible_v = is_trivially_default_constructible::value; // C++17 template inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible::value; // C++17 template inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible::value; // C++17 template inline constexpr bool is_trivially_assignable_v = is_trivially_assignable::value; // C++17 template inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable::value; // C++17 template inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable::value; // C++17 template inline constexpr bool is_trivially_destructible_v = is_trivially_destructible::value; // C++17 template inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible::value; // C++17 template inline constexpr bool is_nothrow_default_constructible_v = is_nothrow_default_constructible::value; // C++17 template inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible::value; // C++17 template inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible::value; // C++17 template inline constexpr bool is_nothrow_assignable_v = is_nothrow_assignable::value; // C++17 template inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable::value; // C++17 template inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable::value; // C++17 template inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with::value; // C++17 template inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable::value; // C++17 template inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible::value; // C++17 template inline constexpr bool has_virtual_destructor_v = has_virtual_destructor::value; // C++17 template inline constexpr bool has_unique_object_representations_v // C++17 = has_unique_object_representations::value; // See C++14 20.10.5, type property queries template inline constexpr size_t alignment_of_v = alignment_of::value; // C++17 template inline constexpr size_t rank_v = rank::value; // C++17 template inline constexpr size_t extent_v = extent::value; // C++17 // See C++14 20.10.6, type relations template inline constexpr bool is_same_v = is_same::value; // C++17 template inline constexpr bool is_base_of_v = is_base_of::value; // C++17 template inline constexpr bool is_convertible_v = is_convertible::value; // C++17 template inline constexpr bool is_invocable_v = is_invocable::value; // C++17 template inline constexpr bool is_invocable_r_v = is_invocable_r::value; // C++17 template inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable::value; // C++17 template inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r::value; // C++17 // [meta.logical], logical operator traits: template struct conjunction; // C++17 template inline constexpr bool conjunction_v = conjunction::value; // C++17 template struct disjunction; // C++17 template inline constexpr bool disjunction_v = disjunction::value; // C++17 template struct negation; // C++17 template inline constexpr bool negation_v = negation::value; // C++17 } */ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__functional/invoke.h> #include <__type_traits/add_const.h> #include <__type_traits/add_cv.h> #include <__type_traits/add_lvalue_reference.h> #include <__type_traits/add_pointer.h> #include <__type_traits/add_rvalue_reference.h> #include <__type_traits/add_volatile.h> #include <__type_traits/aligned_storage.h> #include <__type_traits/aligned_union.h> #include <__type_traits/alignment_of.h> #include <__type_traits/apply_cv.h> #include <__type_traits/common_reference.h> #include <__type_traits/common_type.h> #include <__type_traits/conditional.h> #include <__type_traits/conjunction.h> #include <__type_traits/decay.h> #include <__type_traits/disjunction.h> #include <__type_traits/enable_if.h> #include <__type_traits/extent.h> #include <__type_traits/has_unique_object_representation.h> #include <__type_traits/has_virtual_destructor.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_abstract.h> #include <__type_traits/is_aggregate.h> #include <__type_traits/is_arithmetic.h> #include <__type_traits/is_array.h> #include <__type_traits/is_assignable.h> #include <__type_traits/is_base_of.h> #include <__type_traits/is_bounded_array.h> #include <__type_traits/is_callable.h> #include <__type_traits/is_class.h> #include <__type_traits/is_compound.h> #include <__type_traits/is_const.h> #include <__type_traits/is_constant_evaluated.h> #include <__type_traits/is_constructible.h> #include <__type_traits/is_convertible.h> #include <__type_traits/is_copy_assignable.h> #include <__type_traits/is_copy_constructible.h> #include <__type_traits/is_default_constructible.h> #include <__type_traits/is_destructible.h> #include <__type_traits/is_empty.h> #include <__type_traits/is_enum.h> #include <__type_traits/is_final.h> #include <__type_traits/is_floating_point.h> #include <__type_traits/is_function.h> #include <__type_traits/is_fundamental.h> #include <__type_traits/is_integral.h> #include <__type_traits/is_literal_type.h> #include <__type_traits/is_member_function_pointer.h> #include <__type_traits/is_member_object_pointer.h> #include <__type_traits/is_member_pointer.h> #include <__type_traits/is_move_assignable.h> #include <__type_traits/is_move_constructible.h> #include <__type_traits/is_nothrow_assignable.h> #include <__type_traits/is_nothrow_constructible.h> #include <__type_traits/is_nothrow_convertible.h> #include <__type_traits/is_nothrow_copy_assignable.h> #include <__type_traits/is_nothrow_copy_constructible.h> #include <__type_traits/is_nothrow_default_constructible.h> #include <__type_traits/is_nothrow_destructible.h> #include <__type_traits/is_nothrow_move_assignable.h> #include <__type_traits/is_nothrow_move_constructible.h> #include <__type_traits/is_null_pointer.h> #include <__type_traits/is_object.h> #include <__type_traits/is_pod.h> #include <__type_traits/is_pointer.h> #include <__type_traits/is_polymorphic.h> #include <__type_traits/is_reference.h> #include <__type_traits/is_reference_wrapper.h> #include <__type_traits/is_referenceable.h> #include <__type_traits/is_same.h> #include <__type_traits/is_scalar.h> #include <__type_traits/is_scoped_enum.h> #include <__type_traits/is_signed.h> #include <__type_traits/is_standard_layout.h> #include <__type_traits/is_trivial.h> #include <__type_traits/is_trivially_assignable.h> #include <__type_traits/is_trivially_constructible.h> #include <__type_traits/is_trivially_copy_assignable.h> #include <__type_traits/is_trivially_copy_constructible.h> #include <__type_traits/is_trivially_copyable.h> #include <__type_traits/is_trivially_default_constructible.h> #include <__type_traits/is_trivially_destructible.h> #include <__type_traits/is_trivially_move_assignable.h> #include <__type_traits/is_trivially_move_constructible.h> #include <__type_traits/is_unbounded_array.h> #include <__type_traits/is_union.h> #include <__type_traits/is_unsigned.h> #include <__type_traits/is_void.h> #include <__type_traits/is_volatile.h> #include <__type_traits/make_signed.h> #include <__type_traits/make_unsigned.h> #include <__type_traits/negation.h> #include <__type_traits/rank.h> #include <__type_traits/remove_all_extents.h> #include <__type_traits/remove_const.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_extent.h> #include <__type_traits/remove_pointer.h> #include <__type_traits/remove_reference.h> #include <__type_traits/remove_volatile.h> #include <__type_traits/type_identity.h> #include <__type_traits/underlying_type.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> #include #include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD template struct _LIBCPP_TEMPLATE_VIS pair; template struct _LIBCPP_TEMPLATE_VIS hash; // Member detector base template struct _LIBCPP_TEMPLATE_VIS __dependent_type : public _Tp {}; // is_integral template struct __unconstref { typedef _LIBCPP_NODEBUG typename remove_const::type>::type type; }; #ifndef _LIBCPP_CXX03_LANG // First of all, we can't implement this check in C++03 mode because the {} // default initialization syntax isn't valid. // Second, we implement the trait in a funny manner with two defaulted template // arguments to workaround Clang's PR43454. template void __test_implicit_default_constructible(_Tp); template ::type> struct __is_implicitly_default_constructible : false_type { }; template struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), true_type> : true_type { }; template struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({})), false_type> : false_type { }; #endif // !C++03 // result_of #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS) template class _LIBCPP_DEPRECATED_IN_CXX17 result_of; template class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)> : public __invoke_of<_Fp, _Args...> { }; #if _LIBCPP_STD_VER > 11 template using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type; #endif // _LIBCPP_STD_VER > 11 #endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS) // __swappable template struct __is_swappable; template struct __is_nothrow_swappable; #ifndef _LIBCPP_CXX03_LANG template using __swap_result_t = typename enable_if::value && is_move_assignable<_Tp>::value>::type; #else template using __swap_result_t = void; #endif template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value && is_nothrow_move_assignable<_Tp>::value); template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if< __is_swappable<_Tp>::value >::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value); namespace __detail { // ALL generic swap overloads MUST already have a declaration available at this point. template ::value && !is_void<_Up>::value> struct __swappable_with { template static decltype(swap(declval<_LHS>(), declval<_RHS>())) __test_swap(int); template static __nat __test_swap(long); // Extra parens are needed for the C++03 definition of decltype. typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1; typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2; static const bool value = _IsNotSame<__swap1, __nat>::value && _IsNotSame<__swap2, __nat>::value; }; template struct __swappable_with<_Tp, _Up, false> : false_type {}; template ::value> struct __nothrow_swappable_with { static const bool value = #ifndef _LIBCPP_HAS_NO_NOEXCEPT noexcept(swap(declval<_Tp>(), declval<_Up>())) && noexcept(swap(declval<_Up>(), declval<_Tp>())); #else false; #endif }; template struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {}; } // namespace __detail template struct __is_swappable : public integral_constant::value> { }; template struct __is_nothrow_swappable : public integral_constant::value> { }; #if _LIBCPP_STD_VER > 14 template struct _LIBCPP_TEMPLATE_VIS is_swappable_with : public integral_constant::value> { }; template struct _LIBCPP_TEMPLATE_VIS is_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>, false_type >::type { }; template struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with : public integral_constant::value> { }; template struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_nothrow_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>, false_type >::type { }; template inline constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value; template inline constexpr bool is_swappable_v = is_swappable<_Tp>::value; template inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; template inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value; #endif // _LIBCPP_STD_VER > 14 template ::value> struct __sfinae_underlying_type { typedef typename underlying_type<_Tp>::type type; typedef decltype(((type)1) + 0) __promoted_type; }; template struct __sfinae_underlying_type<_Tp, false> {}; inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR int __convert_to_integral(int __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned __convert_to_integral(unsigned __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long __convert_to_integral(long __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned long __convert_to_integral(unsigned long __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long long __convert_to_integral(long long __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned long long __convert_to_integral(unsigned long long __val) {return __val; } template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if::value, long long>::type __convert_to_integral(_Fp __val) { return __val; } #ifndef _LIBCPP_HAS_NO_INT128 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __int128_t __convert_to_integral(__int128_t __val) { return __val; } inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __uint128_t __convert_to_integral(__uint128_t __val) { return __val; } #endif template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename __sfinae_underlying_type<_Tp>::__promoted_type __convert_to_integral(_Tp __val) { return __val; } // These traits are used in __tree and __hash_table struct __extract_key_fail_tag {}; struct __extract_key_self_tag {}; struct __extract_key_first_tag {}; template ::type> struct __can_extract_key : conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag, __extract_key_fail_tag>::type {}; template struct __can_extract_key<_Pair, _Key, pair<_First, _Second> > : conditional<_IsSame::type, _Key>::value, __extract_key_first_tag, __extract_key_fail_tag>::type {}; // __can_extract_map_key uses true_type/false_type instead of the tags. // It returns true if _Key != _ContainerValueTy (the container is a map not a set) // and _ValTy == _Key. template ::type> struct __can_extract_map_key : integral_constant::value> {}; // This specialization returns __extract_key_fail_tag for non-map containers // because _Key == _ContainerValueTy template struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> : false_type {}; template using _IsCharLikeType = _And, is_trivial<_CharT> >; template using __make_const_lvalue_ref = const typename remove_reference<_Tp>::type&; template using __maybe_const = typename conditional<_Const, const _Tp, _Tp>::type; _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_TYPE_TRAITS