aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__concepts
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__concepts')
-rw-r--r--libcxx/include/__concepts/arithmetic.h4
-rw-r--r--libcxx/include/__concepts/assignable.h3
-rw-r--r--libcxx/include/__concepts/class_or_enum.h7
-rw-r--r--libcxx/include/__concepts/common_reference_with.h2
-rw-r--r--libcxx/include/__concepts/common_with.h9
-rw-r--r--libcxx/include/__concepts/constructible.h2
-rw-r--r--libcxx/include/__concepts/convertible_to.h4
-rw-r--r--libcxx/include/__concepts/derived_from.h3
-rw-r--r--libcxx/include/__concepts/destructible.h2
-rw-r--r--libcxx/include/__concepts/different_from.h2
-rw-r--r--libcxx/include/__concepts/equality_comparable.h3
-rw-r--r--libcxx/include/__concepts/invocable.h1
-rw-r--r--libcxx/include/__concepts/movable.h2
-rw-r--r--libcxx/include/__concepts/predicate.h2
-rw-r--r--libcxx/include/__concepts/same_as.h2
-rw-r--r--libcxx/include/__concepts/swappable.h7
-rw-r--r--libcxx/include/__concepts/totally_ordered.h3
17 files changed, 37 insertions, 21 deletions
diff --git a/libcxx/include/__concepts/arithmetic.h b/libcxx/include/__concepts/arithmetic.h
index d91570f02b8b..215b52aa0218 100644
--- a/libcxx/include/__concepts/arithmetic.h
+++ b/libcxx/include/__concepts/arithmetic.h
@@ -10,9 +10,11 @@
#define _LIBCPP___CONCEPTS_ARITHMETIC_H
#include <__config>
+#include <__type_traits/is_floating_point.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_signed.h>
#include <__type_traits/is_signed_integer.h>
#include <__type_traits/is_unsigned_integer.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/assignable.h b/libcxx/include/__concepts/assignable.h
index 7f187a39f8f8..91edd400adf6 100644
--- a/libcxx/include/__concepts/assignable.h
+++ b/libcxx/include/__concepts/assignable.h
@@ -12,8 +12,9 @@
#include <__concepts/common_reference_with.h>
#include <__concepts/same_as.h>
#include <__config>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/make_const_lvalue_ref.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/class_or_enum.h b/libcxx/include/__concepts/class_or_enum.h
index 9fd62ba89243..c4d2f98952c0 100644
--- a/libcxx/include/__concepts/class_or_enum.h
+++ b/libcxx/include/__concepts/class_or_enum.h
@@ -10,7 +10,10 @@
#define _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_class.h>
+#include <__type_traits/is_enum.h>
+#include <__type_traits/is_union.h>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,7 +31,7 @@ concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
// Work around Clang bug https://llvm.org/PR52970
// TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
template<class _Tp>
-concept __workaround_52970 = is_class_v<__uncvref_t<_Tp>> || is_union_v<__uncvref_t<_Tp>>;
+concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;
#endif // _LIBCPP_STD_VER > 17
diff --git a/libcxx/include/__concepts/common_reference_with.h b/libcxx/include/__concepts/common_reference_with.h
index cae2f5bccce0..cc92762d3109 100644
--- a/libcxx/include/__concepts/common_reference_with.h
+++ b/libcxx/include/__concepts/common_reference_with.h
@@ -12,7 +12,7 @@
#include <__concepts/convertible_to.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/common_reference.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/common_with.h b/libcxx/include/__concepts/common_with.h
index 1b5f4da4af9a..569a0ee3b769 100644
--- a/libcxx/include/__concepts/common_with.h
+++ b/libcxx/include/__concepts/common_with.h
@@ -12,7 +12,10 @@
#include <__concepts/common_reference_with.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/common_reference.h>
+#include <__type_traits/common_type.h>
+#include <__utility/declval.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,8 +31,8 @@ template<class _Tp, class _Up>
concept common_with =
same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
requires {
- static_cast<common_type_t<_Tp, _Up>>(declval<_Tp>());
- static_cast<common_type_t<_Tp, _Up>>(declval<_Up>());
+ static_cast<common_type_t<_Tp, _Up>>(std::declval<_Tp>());
+ static_cast<common_type_t<_Tp, _Up>>(std::declval<_Up>());
} &&
common_reference_with<
add_lvalue_reference_t<const _Tp>,
diff --git a/libcxx/include/__concepts/constructible.h b/libcxx/include/__concepts/constructible.h
index aaf515417e4c..1d78eb5fd157 100644
--- a/libcxx/include/__concepts/constructible.h
+++ b/libcxx/include/__concepts/constructible.h
@@ -12,7 +12,7 @@
#include <__concepts/convertible_to.h>
#include <__concepts/destructible.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_constructible.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/convertible_to.h b/libcxx/include/__concepts/convertible_to.h
index 5d9d43710421..2c1d2674100f 100644
--- a/libcxx/include/__concepts/convertible_to.h
+++ b/libcxx/include/__concepts/convertible_to.h
@@ -10,8 +10,8 @@
#define _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
#include <__config>
+#include <__type_traits/is_convertible.h>
#include <__utility/declval.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -27,7 +27,7 @@ template<class _From, class _To>
concept convertible_to =
is_convertible_v<_From, _To> &&
requires {
- static_cast<_To>(declval<_From>());
+ static_cast<_To>(std::declval<_From>());
};
#endif // _LIBCPP_STD_VER > 17
diff --git a/libcxx/include/__concepts/derived_from.h b/libcxx/include/__concepts/derived_from.h
index 4b2914794735..0d3462df6a6d 100644
--- a/libcxx/include/__concepts/derived_from.h
+++ b/libcxx/include/__concepts/derived_from.h
@@ -10,7 +10,8 @@
#define _LIBCPP___CONCEPTS_DERIVED_FROM_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/is_convertible.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/destructible.h b/libcxx/include/__concepts/destructible.h
index 90a043d314c2..ad3819d5dcfe 100644
--- a/libcxx/include/__concepts/destructible.h
+++ b/libcxx/include/__concepts/destructible.h
@@ -10,7 +10,7 @@
#define _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_nothrow_destructible.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/different_from.h b/libcxx/include/__concepts/different_from.h
index 3066372e8683..15fd8f05510b 100644
--- a/libcxx/include/__concepts/different_from.h
+++ b/libcxx/include/__concepts/different_from.h
@@ -11,7 +11,7 @@
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/equality_comparable.h b/libcxx/include/__concepts/equality_comparable.h
index 7c750c5937b5..b865141705f1 100644
--- a/libcxx/include/__concepts/equality_comparable.h
+++ b/libcxx/include/__concepts/equality_comparable.h
@@ -12,7 +12,8 @@
#include <__concepts/boolean_testable.h>
#include <__concepts/common_reference_with.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/common_reference.h>
+#include <__type_traits/make_const_lvalue_ref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/invocable.h b/libcxx/include/__concepts/invocable.h
index d90389e97f3b..ec39b7b817cc 100644
--- a/libcxx/include/__concepts/invocable.h
+++ b/libcxx/include/__concepts/invocable.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__functional/invoke.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/movable.h b/libcxx/include/__concepts/movable.h
index 639219ed6b48..749b78ad10b8 100644
--- a/libcxx/include/__concepts/movable.h
+++ b/libcxx/include/__concepts/movable.h
@@ -13,7 +13,7 @@
#include <__concepts/constructible.h>
#include <__concepts/swappable.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_object.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/predicate.h b/libcxx/include/__concepts/predicate.h
index cb239752309f..7ae97832642d 100644
--- a/libcxx/include/__concepts/predicate.h
+++ b/libcxx/include/__concepts/predicate.h
@@ -12,7 +12,7 @@
#include <__concepts/boolean_testable.h>
#include <__concepts/invocable.h>
#include <__config>
-#include <type_traits>
+#include <__functional/invoke.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/same_as.h b/libcxx/include/__concepts/same_as.h
index 765490661148..554ebc3b074b 100644
--- a/libcxx/include/__concepts/same_as.h
+++ b/libcxx/include/__concepts/same_as.h
@@ -10,7 +10,7 @@
#define _LIBCPP___CONCEPTS_SAME_AS_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_same.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/swappable.h b/libcxx/include/__concepts/swappable.h
index fef940f21fed..d91a7a1dc3c3 100644
--- a/libcxx/include/__concepts/swappable.h
+++ b/libcxx/include/__concepts/swappable.h
@@ -14,10 +14,15 @@
#include <__concepts/common_reference_with.h>
#include <__concepts/constructible.h>
#include <__config>
+#include <__type_traits/extent.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/exchange.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <__utility/swap.h>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__concepts/totally_ordered.h b/libcxx/include/__concepts/totally_ordered.h
index 25347790de07..f12d26b10827 100644
--- a/libcxx/include/__concepts/totally_ordered.h
+++ b/libcxx/include/__concepts/totally_ordered.h
@@ -12,7 +12,8 @@
#include <__concepts/boolean_testable.h>
#include <__concepts/equality_comparable.h>
#include <__config>
-#include <type_traits>
+#include <__type_traits/common_reference.h>
+#include <__type_traits/make_const_lvalue_ref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header