From 3abaefe64c22a0c2f2a10202188aca7696f657bd Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 13 Jun 2022 17:36:53 +0200 Subject: [PATCH] [libc++] Granularize some more of Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D127631 --- libcxx/include/CMakeLists.txt | 23 + libcxx/include/__type_traits/is_constructible.h | 33 ++ .../include/__type_traits/is_copy_constructible.h | 36 ++ .../__type_traits/is_default_constructible.h | 34 ++ libcxx/include/__type_traits/is_destructible.h | 102 +++++ .../include/__type_traits/is_move_constructible.h | 35 ++ .../include/__type_traits/is_nothrow_assignable.h | 59 +++ .../__type_traits/is_nothrow_constructible.h | 75 ++++ .../__type_traits/is_nothrow_copy_assignable.h | 35 ++ .../__type_traits/is_nothrow_copy_constructible.h | 35 ++ .../is_nothrow_default_constructible.h | 33 ++ .../__type_traits/is_nothrow_destructible.h | 90 ++++ .../__type_traits/is_nothrow_move_assignable.h | 36 ++ .../__type_traits/is_nothrow_move_constructible.h | 34 ++ .../__type_traits/is_trivially_assignable.h | 33 ++ .../__type_traits/is_trivially_constructible.h | 34 ++ .../__type_traits/is_trivially_copy_assignable.h | 35 ++ .../is_trivially_copy_constructible.h | 34 ++ .../is_trivially_default_constructible.h | 33 ++ .../__type_traits/is_trivially_destructible.h | 52 +++ .../__type_traits/is_trivially_move_assignable.h | 36 ++ .../is_trivially_move_constructible.h | 34 ++ libcxx/include/__type_traits/negation.h | 33 ++ libcxx/include/__type_traits/void_t.h | 29 ++ libcxx/include/module.modulemap.in | 171 ++++---- libcxx/include/type_traits | 484 +-------------------- libcxx/test/libcxx/private_headers.verify.cpp | 23 + 27 files changed, 1156 insertions(+), 535 deletions(-) create mode 100644 libcxx/include/__type_traits/is_constructible.h create mode 100644 libcxx/include/__type_traits/is_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_destructible.h create mode 100644 libcxx/include/__type_traits/is_move_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_copy_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_destructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_move_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_move_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_copy_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_destructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_move_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_move_constructible.h create mode 100644 libcxx/include/__type_traits/negation.h create mode 100644 libcxx/include/__type_traits/void_t.h diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index 697f396..add13fc 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -480,9 +480,13 @@ set(files __type_traits/is_compound.h __type_traits/is_const.h __type_traits/is_constant_evaluated.h + __type_traits/is_constructible.h __type_traits/is_convertible.h __type_traits/is_copy_assignable.h + __type_traits/is_copy_constructible.h __type_traits/is_core_convertible.h + __type_traits/is_default_constructible.h + __type_traits/is_destructible.h __type_traits/is_empty.h __type_traits/is_enum.h __type_traits/is_final.h @@ -495,6 +499,15 @@ set(files __type_traits/is_member_object_pointer.h __type_traits/is_member_pointer.h __type_traits/is_move_assignable.h + __type_traits/is_move_constructible.h + __type_traits/is_nothrow_assignable.h + __type_traits/is_nothrow_constructible.h + __type_traits/is_nothrow_copy_assignable.h + __type_traits/is_nothrow_copy_constructible.h + __type_traits/is_nothrow_default_constructible.h + __type_traits/is_nothrow_destructible.h + __type_traits/is_nothrow_move_assignable.h + __type_traits/is_nothrow_move_constructible.h __type_traits/is_null_pointer.h __type_traits/is_object.h __type_traits/is_pod.h @@ -509,12 +522,21 @@ set(files __type_traits/is_signed.h __type_traits/is_standard_layout.h __type_traits/is_trivial.h + __type_traits/is_trivially_assignable.h + __type_traits/is_trivially_constructible.h + __type_traits/is_trivially_copy_assignable.h + __type_traits/is_trivially_copy_constructible.h __type_traits/is_trivially_copyable.h + __type_traits/is_trivially_default_constructible.h + __type_traits/is_trivially_destructible.h + __type_traits/is_trivially_move_assignable.h + __type_traits/is_trivially_move_constructible.h __type_traits/is_unbounded_array.h __type_traits/is_union.h __type_traits/is_unsigned.h __type_traits/is_void.h __type_traits/is_volatile.h + __type_traits/negation.h __type_traits/rank.h __type_traits/remove_all_extents.h __type_traits/remove_const.h @@ -525,6 +547,7 @@ set(files __type_traits/remove_volatile.h __type_traits/type_identity.h __type_traits/underlying_type.h + __type_traits/void_t.h __undef_macros __utility/as_const.h __utility/auto_cast.h diff --git a/libcxx/include/__type_traits/is_constructible.h b/libcxx/include/__type_traits/is_constructible.h new file mode 100644 index 0000000..9a96c3d --- /dev/null +++ b/libcxx/include/__type_traits/is_constructible.h @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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_IS_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_TEMPLATE_VIS is_constructible + : public integral_constant +{ }; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_constructible_v = is_constructible<_Tp, _Args...>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_copy_constructible.h b/libcxx/include/__type_traits/is_copy_constructible.h new file mode 100644 index 0000000..18dc27f --- /dev/null +++ b/libcxx/include/__type_traits/is_copy_constructible.h @@ -0,0 +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_IS_COPY_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_TEMPLATE_VIS is_copy_constructible + : public is_constructible<_Tp, + typename add_lvalue_reference::type>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_default_constructible.h b/libcxx/include/__type_traits/is_default_constructible.h new file mode 100644 index 0000000..a636841 --- /dev/null +++ b/libcxx/include/__type_traits/is_default_constructible.h @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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_DEFAULT_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_TEMPLATE_VIS is_default_constructible + : public is_constructible<_Tp> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_default_constructible_v = is_default_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_destructible.h b/libcxx/include/__type_traits/is_destructible.h new file mode 100644 index 0000000..4894510 --- /dev/null +++ b/libcxx/include/__type_traits/is_destructible.h @@ -0,0 +1,102 @@ +//===----------------------------------------------------------------------===// +// +// 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_DESTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_function.h> +#include <__type_traits/is_reference.h> +#include <__type_traits/remove_all_extents.h> +#include <__utility/declval.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if __has_keyword(__is_destructible) + +template +struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_destructible_v = __is_destructible(_Tp); +#endif + +#else // __has_keyword(__is_destructible) + +// if it's a reference, return true +// if it's a function, return false +// if it's void, return false +// if it's an array of unknown bound, return false +// Otherwise, return "declval<_Up&>().~_Up()" is well-formed +// where _Up is remove_all_extents<_Tp>::type + +template +struct __is_destructible_apply { typedef int type; }; + +template +struct __is_destructor_wellformed { + template + static true_type __test ( + typename __is_destructible_apply().~_Tp1())>::type + ); + + template + static false_type __test (...); + + static const bool value = decltype(__test<_Tp>(12))::value; +}; + +template +struct __destructible_imp; + +template +struct __destructible_imp<_Tp, false> + : public integral_constant::type>::value> {}; + +template +struct __destructible_imp<_Tp, true> + : public true_type {}; + +template +struct __destructible_false; + +template +struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, is_reference<_Tp>::value> {}; + +template +struct __destructible_false<_Tp, true> : public false_type {}; + +template +struct is_destructible + : public __destructible_false<_Tp, is_function<_Tp>::value> {}; + +template +struct is_destructible<_Tp[]> + : public false_type {}; + +template <> +struct is_destructible + : public false_type {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_destructible_v = is_destructible<_Tp>::value; +#endif + +#endif // __has_keyword(__is_destructible) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_move_constructible.h b/libcxx/include/__type_traits/is_move_constructible.h new file mode 100644 index 0000000..228cee7 --- /dev/null +++ b/libcxx/include/__type_traits/is_move_constructible.h @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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_MOVE_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_rvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_TEMPLATE_VIS is_move_constructible + : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_assignable.h b/libcxx/include/__type_traits/is_nothrow_assignable.h new file mode 100644 index 0000000..18e0e70 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_assignable.h @@ -0,0 +1,59 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if __has_keyword(__is_nothrow_assignable) + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable + : public integral_constant {}; + +#else + +template struct __libcpp_is_nothrow_assignable; + +template +struct __libcpp_is_nothrow_assignable + : public false_type +{ +}; + +template +struct __libcpp_is_nothrow_assignable + : public integral_constant() = declval<_Arg>()) > +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable + : public __libcpp_is_nothrow_assignable::value, _Tp, _Arg> +{ +}; + +#endif // _LIBCPP_HAS_NO_NOEXCEPT + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_assignable_v = is_nothrow_assignable<_Tp, _Arg>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_constructible.h b/libcxx/include/__type_traits/is_nothrow_constructible.h new file mode 100644 index 0000000..1f25d61 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_constructible.h @@ -0,0 +1,75 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__utility/declval.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if __has_keyword(__is_nothrow_constructible) + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible + : public integral_constant {}; + +#else + +template struct __libcpp_is_nothrow_constructible; + +template +struct __libcpp_is_nothrow_constructible + : public integral_constant()...))> +{ +}; + +template +void __implicit_conversion_to(_Tp) noexcept { } + +template +struct __libcpp_is_nothrow_constructible + : public integral_constant(declval<_Arg>()))> +{ +}; + +template +struct __libcpp_is_nothrow_constructible + : public false_type +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible + : __libcpp_is_nothrow_constructible::value, is_reference<_Tp>::value, _Tp, _Args...> +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]> + : __libcpp_is_nothrow_constructible::value, is_reference<_Tp>::value, _Tp> +{ +}; + +#endif // _LIBCPP_HAS_NO_NOEXCEPT + + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h new file mode 100644 index 0000000..8c4b8fd1 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_COPY_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_nothrow_assignable.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable + : public is_nothrow_assignable::type, + typename add_lvalue_reference::type>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h new file mode 100644 index 0000000..966df86 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_COPY_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_nothrow_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible + : public is_nothrow_constructible<_Tp, + typename add_lvalue_reference::type>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_default_constructible.h b/libcxx/include/__type_traits/is_nothrow_default_constructible.h new file mode 100644 index 0000000..addf359 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_default_constructible.h @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_DEFAULT_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_nothrow_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible + : public is_nothrow_constructible<_Tp> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_default_constructible_v = is_nothrow_default_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_destructible.h b/libcxx/include/__type_traits/is_nothrow_destructible.h new file mode 100644 index 0000000..4763ae8 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_destructible.h @@ -0,0 +1,90 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_DESTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_destructible.h> +#include <__type_traits/is_reference.h> +#include <__type_traits/is_scalar.h> +#include <__type_traits/remove_all_extents.h> +#include <__utility/declval.h> +#include + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_CXX03_LANG) + +template struct __libcpp_is_nothrow_destructible; + +template +struct __libcpp_is_nothrow_destructible + : public false_type +{ +}; + +template +struct __libcpp_is_nothrow_destructible + : public integral_constant().~_Tp()) > +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible + : public __libcpp_is_nothrow_destructible::value, _Tp> +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]> + : public is_nothrow_destructible<_Tp> +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> + : public true_type +{ +}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> + : public true_type +{ +}; + +#else + +template struct __libcpp_nothrow_destructor + : public integral_constant::value || + is_reference<_Tp>::value> {}; + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible + : public __libcpp_nothrow_destructor::type> {}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> + : public false_type {}; + +#endif + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/libcxx/include/__type_traits/is_nothrow_move_assignable.h new file mode 100644 index 0000000..44cea1f --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_move_assignable.h @@ -0,0 +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_IS_NOTHROW_MOVE_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/add_rvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_nothrow_assignable.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable + : public is_nothrow_assignable::type, + typename add_rvalue_reference<_Tp>::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/libcxx/include/__type_traits/is_nothrow_move_constructible.h new file mode 100644 index 0000000..e3b1171 --- /dev/null +++ b/libcxx/include/__type_traits/is_nothrow_move_constructible.h @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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_NOTHROW_MOVE_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_rvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_nothrow_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible + : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_trivially_assignable.h b/libcxx/include/__type_traits/is_trivially_assignable.h new file mode 100644 index 0000000..01540f9 --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_assignable.h @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct is_trivially_assignable + : integral_constant +{ }; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_assignable_v = is_trivially_assignable<_Tp, _Arg>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_trivially_constructible.h b/libcxx/include/__type_traits/is_trivially_constructible.h new file mode 100644 index 0000000..92ea580 --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_constructible.h @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible + : integral_constant +{ +}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_constructible_v = is_trivially_constructible<_Tp, _Args...>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/libcxx/include/__type_traits/is_trivially_copy_assignable.h new file mode 100644 index 0000000..066d763 --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_copy_assignable.h @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_COPY_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/add_const.h> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_trivially_assignable.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable + : public is_trivially_assignable::type, + typename add_lvalue_reference::type>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/libcxx/include/__type_traits/is_trivially_copy_constructible.h new file mode 100644 index 0000000..e0c054d --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_copy_constructible.h @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_COPY_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_trivially_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible + : public is_trivially_constructible<_Tp, typename add_lvalue_reference::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_trivially_default_constructible.h b/libcxx/include/__type_traits/is_trivially_default_constructible.h new file mode 100644 index 0000000..822fa9c --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_default_constructible.h @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_trivially_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible + : public is_trivially_constructible<_Tp> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_default_constructible_v = is_trivially_default_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_trivially_destructible.h b/libcxx/include/__type_traits/is_trivially_destructible.h new file mode 100644 index 0000000..81181cd --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_destructible.h @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_DESTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H + +#include <__config> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if __has_keyword(__is_trivially_destructible) + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible + : public integral_constant {}; + +#elif __has_feature(has_trivial_destructor) || defined(_LIBCPP_COMPILER_GCC) + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible + : public integral_constant::value && __has_trivial_destructor(_Tp)> {}; + +#else + +template struct __libcpp_trivial_destructor + : public integral_constant::value || + is_reference<_Tp>::value> {}; + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible + : public __libcpp_trivial_destructor::type> {}; + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible<_Tp[]> + : public false_type {}; + +#endif + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/is_trivially_move_assignable.h b/libcxx/include/__type_traits/is_trivially_move_assignable.h new file mode 100644 index 0000000..fc033a4 --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_move_assignable.h @@ -0,0 +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_IS_TRIVIALLY_MOVE_ASSIGNABLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H + +#include <__config> +#include <__type_traits/add_lvalue_reference.h> +#include <__type_traits/add_rvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_trivially_assignable.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable + : public is_trivially_assignable::type, + typename add_rvalue_reference<_Tp>::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H diff --git a/libcxx/include/__type_traits/is_trivially_move_constructible.h b/libcxx/include/__type_traits/is_trivially_move_constructible.h new file mode 100644 index 0000000..be005cc --- /dev/null +++ b/libcxx/include/__type_traits/is_trivially_move_constructible.h @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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_TRIVIALLY_MOVE_CONSTRUCTIBLE_H +#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H + +#include <__config> +#include <__type_traits/add_rvalue_reference.h> +#include <__type_traits/integral_constant.h> +#include <__type_traits/is_trivially_constructible.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible + : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> + {}; + +#if _LIBCPP_STD_VER > 14 +template +inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H diff --git a/libcxx/include/__type_traits/negation.h b/libcxx/include/__type_traits/negation.h new file mode 100644 index 0000000..92f205f --- /dev/null +++ b/libcxx/include/__type_traits/negation.h @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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_NEGATION_H +#define _LIBCPP___TYPE_TRAITS_NEGATION_H + +#include <__config> +#include <__type_traits/integral_constant.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct _Not : _BoolConstant {}; + +#if _LIBCPP_STD_VER > 14 +template +struct negation : _Not<_Tp> {}; +template +inline constexpr bool negation_v = negation<_Tp>::value; +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_NEGATION_H diff --git a/libcxx/include/__type_traits/void_t.h b/libcxx/include/__type_traits/void_t.h new file mode 100644 index 0000000..a71ab5e --- /dev/null +++ b/libcxx/include/__type_traits/void_t.h @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// 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_VOID_T_H +#define _LIBCPP___TYPE_TRAITS_VOID_T_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 +template using void_t = void; +#endif + +template +struct __void_t { typedef void type; }; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___TYPE_TRAITS_VOID_T_H diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in index a128024..ab79cf7 100644 --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -1030,80 +1030,103 @@ module std [system] { export functional.__functional.unwrap_ref export * - module add_const { private header "__type_traits/add_const.h" } - module add_cv { private header "__type_traits/add_cv.h" } - module add_lvalue_reference { private header "__type_traits/add_lvalue_reference.h" } - module add_pointer { private header "__type_traits/add_pointer.h" } - module add_rvalue_reference { private header "__type_traits/add_rvalue_reference.h" } - module add_volatile { private header "__type_traits/add_volatile.h" } - module alignment_of { private header "__type_traits/alignment_of.h" } - module apply_cv { private header "__type_traits/apply_cv.h" } - module conditional { private header "__type_traits/conditional.h" } - module conjunction { private header "__type_traits/conjunction.h" } - module decay { private header "__type_traits/decay.h" } - module disjunction { private header "__type_traits/disjunction.h" } - module enable_if { private header "__type_traits/enable_if.h" } - module extent { private header "__type_traits/extent.h" } - module has_unique_object_representation { private header "__type_traits/has_unique_object_representation.h" } - module has_virtual_destructor { private header "__type_traits/has_virtual_destructor.h" } - module integral_constant { private header "__type_traits/integral_constant.h" } - module is_abstract { private header "__type_traits/is_abstract.h" } - module is_aggregate { private header "__type_traits/is_aggregate.h" } - module is_arithmetic { private header "__type_traits/is_arithmetic.h" } - module is_array { private header "__type_traits/is_array.h" } - module is_assignable { private header "__type_traits/is_assignable.h" } - module is_base_of { private header "__type_traits/is_base_of.h" } - module is_bounded_array { private header "__type_traits/is_bounded_array.h" } - module is_callable { private header "__type_traits/is_callable.h" } - module is_class { private header "__type_traits/is_class.h" } - module is_compound { private header "__type_traits/is_compound.h" } - module is_const { private header "__type_traits/is_const.h" } - module is_constant_evaluated { private header "__type_traits/is_constant_evaluated.h" } - module is_convertible { private header "__type_traits/is_convertible.h" } - module is_copy_assignable { private header "__type_traits/is_copy_assignable.h" } - module is_core_convertible { private header "__type_traits/is_core_convertible.h" } - module is_empty { private header "__type_traits/is_empty.h" } - module is_enum { private header "__type_traits/is_enum.h" } - module is_final { private header "__type_traits/is_final.h" } - module is_floating_point { private header "__type_traits/is_floating_point.h" } - module is_function { private header "__type_traits/is_function.h" } - module is_fundamental { private header "__type_traits/is_fundamental.h" } - module is_integral { private header "__type_traits/is_integral.h" } - module is_literal_type { private header "__type_traits/is_literal_type.h" } - module is_member_function_pointer { private header "__type_traits/is_member_function_pointer.h" } - module is_member_object_pointer { private header "__type_traits/is_member_object_pointer.h" } - module is_member_pointer { private header "__type_traits/is_member_pointer.h" } - module is_move_assignable { private header "__type_traits/is_move_assignable.h" } - module is_null_pointer { private header "__type_traits/is_null_pointer.h" } - module is_object { private header "__type_traits/is_object.h" } - module is_pod { private header "__type_traits/is_pod.h" } - module is_pointer { private header "__type_traits/is_pointer.h" } - module is_polymorphic { private header "__type_traits/is_polymorphic.h" } - module is_reference { private header "__type_traits/is_reference.h" } - module is_reference_wrapper { private header "__type_traits/is_reference_wrapper.h" } - module is_referenceable { private header "__type_traits/is_referenceable.h" } - module is_same { private header "__type_traits/is_same.h" } - module is_scalar { private header "__type_traits/is_scalar.h" } - module is_scoped_enum { private header "__type_traits/is_scoped_enum.h" } - module is_signed { private header "__type_traits/is_signed.h" } - module is_standard_layout { private header "__type_traits/is_standard_layout.h" } - module is_trivial { private header "__type_traits/is_trivial.h" } - module is_trivially_copyable { private header "__type_traits/is_trivially_copyable.h" } - module is_unbounded_array { private header "__type_traits/is_unbounded_array.h" } - module is_union { private header "__type_traits/is_union.h" } - module is_unsigned { private header "__type_traits/is_unsigned.h" } - module is_void { private header "__type_traits/is_void.h" } - module is_volatile { private header "__type_traits/is_volatile.h" } - module rank { private header "__type_traits/rank.h" } - module remove_all_extents { private header "__type_traits/remove_all_extents.h" } - module remove_const { private header "__type_traits/remove_const.h" } - module remove_cv { private header "__type_traits/remove_cv.h" } - module remove_extent { private header "__type_traits/remove_extent.h" } - module remove_pointer { private header "__type_traits/remove_pointer.h" } - module remove_reference { private header "__type_traits/remove_reference.h" } - module remove_volatile { private header "__type_traits/remove_volatile.h" } - module type_identity { private header "__type_traits/type_identity.h" } - module underlying_type { private header "__type_traits/underlying_type.h" } + module add_const { private header "__type_traits/add_const.h" } + module add_cv { private header "__type_traits/add_cv.h" } + module add_lvalue_reference { private header "__type_traits/add_lvalue_reference.h" } + module add_pointer { private header "__type_traits/add_pointer.h" } + module add_rvalue_reference { private header "__type_traits/add_rvalue_reference.h" } + module add_volatile { private header "__type_traits/add_volatile.h" } + module alignment_of { private header "__type_traits/alignment_of.h" } + module apply_cv { private header "__type_traits/apply_cv.h" } + module conditional { private header "__type_traits/conditional.h" } + module conjunction { private header "__type_traits/conjunction.h" } + module decay { private header "__type_traits/decay.h" } + module disjunction { private header "__type_traits/disjunction.h" } + module enable_if { private header "__type_traits/enable_if.h" } + module extent { private header "__type_traits/extent.h" } + module has_unique_object_representation { private header "__type_traits/has_unique_object_representation.h" } + module has_virtual_destructor { private header "__type_traits/has_virtual_destructor.h" } + module integral_constant { private header "__type_traits/integral_constant.h" } + module is_abstract { private header "__type_traits/is_abstract.h" } + module is_aggregate { private header "__type_traits/is_aggregate.h" } + module is_arithmetic { private header "__type_traits/is_arithmetic.h" } + module is_array { private header "__type_traits/is_array.h" } + module is_assignable { private header "__type_traits/is_assignable.h" } + module is_base_of { private header "__type_traits/is_base_of.h" } + module is_bounded_array { private header "__type_traits/is_bounded_array.h" } + module is_callable { private header "__type_traits/is_callable.h" } + module is_class { private header "__type_traits/is_class.h" } + module is_compound { private header "__type_traits/is_compound.h" } + module is_const { private header "__type_traits/is_const.h" } + module is_constant_evaluated { private header "__type_traits/is_constant_evaluated.h" } + module is_constructible { private header "__type_traits/is_constructible.h" } + module is_convertible { private header "__type_traits/is_convertible.h" } + module is_copy_assignable { private header "__type_traits/is_copy_assignable.h" } + module is_copy_constructible { private header "__type_traits/is_copy_constructible.h" } + module is_core_convertible { private header "__type_traits/is_core_convertible.h" } + module is_default_constructible { private header "__type_traits/is_default_constructible.h" } + module is_destructible { private header "__type_traits/is_destructible.h" } + module is_empty { private header "__type_traits/is_empty.h" } + module is_enum { private header "__type_traits/is_enum.h" } + module is_final { private header "__type_traits/is_final.h" } + module is_floating_point { private header "__type_traits/is_floating_point.h" } + module is_function { private header "__type_traits/is_function.h" } + module is_fundamental { private header "__type_traits/is_fundamental.h" } + module is_integral { private header "__type_traits/is_integral.h" } + module is_literal_type { private header "__type_traits/is_literal_type.h" } + module is_member_function_pointer { private header "__type_traits/is_member_function_pointer.h" } + module is_member_object_pointer { private header "__type_traits/is_member_object_pointer.h" } + module is_member_pointer { private header "__type_traits/is_member_pointer.h" } + module is_move_assignable { private header "__type_traits/is_move_assignable.h" } + module is_move_constructible { private header "__type_traits/is_move_constructible.h" } + module is_nothrow_assignable { private header "__type_traits/is_nothrow_assignable.h" } + module is_nothrow_constructible { private header "__type_traits/is_nothrow_constructible.h" } + module is_nothrow_copy_assignable { private header "__type_traits/is_nothrow_copy_assignable.h" } + module is_nothrow_copy_constructible { private header "__type_traits/is_nothrow_copy_constructible.h" } + module is_nothrow_default_constructible { private header "__type_traits/is_nothrow_default_constructible.h" } + module is_nothrow_destructible { private header "__type_traits/is_nothrow_destructible.h" } + module is_nothrow_move_assignable { private header "__type_traits/is_nothrow_move_assignable.h" } + module is_nothrow_move_constructible { private header "__type_traits/is_nothrow_move_constructible.h" } + module is_null_pointer { private header "__type_traits/is_null_pointer.h" } + module is_object { private header "__type_traits/is_object.h" } + module is_pod { private header "__type_traits/is_pod.h" } + module is_pointer { private header "__type_traits/is_pointer.h" } + module is_polymorphic { private header "__type_traits/is_polymorphic.h" } + module is_reference { private header "__type_traits/is_reference.h" } + module is_reference_wrapper { private header "__type_traits/is_reference_wrapper.h" } + module is_referenceable { private header "__type_traits/is_referenceable.h" } + module is_same { private header "__type_traits/is_same.h" } + module is_scalar { private header "__type_traits/is_scalar.h" } + module is_scoped_enum { private header "__type_traits/is_scoped_enum.h" } + module is_signed { private header "__type_traits/is_signed.h" } + module is_standard_layout { private header "__type_traits/is_standard_layout.h" } + module is_trivial { private header "__type_traits/is_trivial.h" } + module is_trivially_assignable { private header "__type_traits/is_trivially_assignable.h" } + module is_trivially_constructible { private header "__type_traits/is_trivially_constructible.h" } + module is_trivially_copy_assignable { private header "__type_traits/is_trivially_copy_assignable.h" } + module is_trivially_copy_constructible { private header "__type_traits/is_trivially_copy_constructible.h" } + module is_trivially_copyable { private header "__type_traits/is_trivially_copyable.h" } + module is_trivially_default_constructible { private header "__type_traits/is_trivially_default_constructible.h" } + module is_trivially_destructible { private header "__type_traits/is_trivially_destructible.h" } + module is_trivially_move_assignable { private header "__type_traits/is_trivially_move_assignable.h" } + module is_trivially_move_constructible { private header "__type_traits/is_trivially_move_constructible.h" } + module is_unbounded_array { private header "__type_traits/is_unbounded_array.h" } + module is_union { private header "__type_traits/is_union.h" } + module is_unsigned { private header "__type_traits/is_unsigned.h" } + module is_void { private header "__type_traits/is_void.h" } + module is_volatile { private header "__type_traits/is_volatile.h" } + module negation { private header "__type_traits/negation.h" } + module rank { private header "__type_traits/rank.h" } + module remove_all_extents { private header "__type_traits/remove_all_extents.h" } + module remove_const { private header "__type_traits/remove_const.h" } + module remove_cv { private header "__type_traits/remove_cv.h" } + module remove_extent { private header "__type_traits/remove_extent.h" } + module remove_pointer { private header "__type_traits/remove_pointer.h" } + module remove_reference { private header "__type_traits/remove_reference.h" } + module remove_volatile { private header "__type_traits/remove_volatile.h" } + module type_identity { private header "__type_traits/type_identity.h" } + module underlying_type { private header "__type_traits/underlying_type.h" } + module void_t { private header "__type_traits/void_t.h" } } module typeindex { header "typeindex" diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 44aa4b2..abd05ae 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -448,8 +448,12 @@ namespace std #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> @@ -462,6 +466,15 @@ namespace std #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_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> @@ -476,12 +489,21 @@ namespace std #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/negation.h> #include <__type_traits/rank.h> #include <__type_traits/remove_all_extents.h> #include <__type_traits/remove_const.h> @@ -492,6 +514,7 @@ namespace std #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 @@ -533,8 +556,6 @@ template using _If _LIBCPP_NODEBUG = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>; template using _Or _LIBCPP_NODEBUG = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl; -template -struct _Not : _BoolConstant {}; template using _FirstType _LIBCPP_NODEBUG = typename _MetaBase<(sizeof...(_Args) >= 1)>::template _FirstImpl<_Args...>; template @@ -561,9 +582,6 @@ false_type __sfinae_test_impl(...); template