Skip to content

Commit f038dfd

Browse files
authored
[libc++] Merge is_{,un}bounded_array.h into is_array.h (#167479)
These headers are incredibly simple and closely related, so this merges them into a single one.
1 parent 189d185 commit f038dfd

File tree

10 files changed

+26
-92
lines changed

10 files changed

+26
-92
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ set(files
822822
__type_traits/is_array.h
823823
__type_traits/is_assignable.h
824824
__type_traits/is_base_of.h
825-
__type_traits/is_bounded_array.h
826825
__type_traits/is_callable.h
827826
__type_traits/is_char_like_type.h
828827
__type_traits/is_class.h
@@ -872,7 +871,6 @@ set(files
872871
__type_traits/is_trivially_destructible.h
873872
__type_traits/is_trivially_lexicographically_comparable.h
874873
__type_traits/is_trivially_relocatable.h
875-
__type_traits/is_unbounded_array.h
876874
__type_traits/is_union.h
877875
__type_traits/is_unqualified.h
878876
__type_traits/is_unsigned.h

libcxx/include/__memory/shared_ptr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@
4141
#include <__type_traits/enable_if.h>
4242
#include <__type_traits/integral_constant.h>
4343
#include <__type_traits/is_array.h>
44-
#include <__type_traits/is_bounded_array.h>
4544
#include <__type_traits/is_constructible.h>
4645
#include <__type_traits/is_convertible.h>
4746
#include <__type_traits/is_function.h>
4847
#include <__type_traits/is_reference.h>
4948
#include <__type_traits/is_same.h>
50-
#include <__type_traits/is_unbounded_array.h>
5149
#include <__type_traits/nat.h>
5250
#include <__type_traits/negation.h>
5351
#include <__type_traits/remove_cv.h>

libcxx/include/__memory/uninitialized_algorithms.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <__type_traits/is_trivially_assignable.h>
3333
#include <__type_traits/is_trivially_constructible.h>
3434
#include <__type_traits/is_trivially_relocatable.h>
35-
#include <__type_traits/is_unbounded_array.h>
3635
#include <__type_traits/remove_const.h>
3736
#include <__type_traits/remove_extent.h>
3837
#include <__utility/exception_guard.h>

libcxx/include/__memory/unique_ptr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <__type_traits/integral_constant.h>
3333
#include <__type_traits/is_array.h>
3434
#include <__type_traits/is_assignable.h>
35-
#include <__type_traits/is_bounded_array.h>
3635
#include <__type_traits/is_constant_evaluated.h>
3736
#include <__type_traits/is_constructible.h>
3837
#include <__type_traits/is_convertible.h>
@@ -42,7 +41,6 @@
4241
#include <__type_traits/is_same.h>
4342
#include <__type_traits/is_swappable.h>
4443
#include <__type_traits/is_trivially_relocatable.h>
45-
#include <__type_traits/is_unbounded_array.h>
4644
#include <__type_traits/is_void.h>
4745
#include <__type_traits/remove_extent.h>
4846
#include <__type_traits/type_identity.h>

libcxx/include/__type_traits/is_array.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ template <class _Tp>
2626
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_array_v = __is_array(_Tp);
2727
#endif
2828

29+
template <class _Tp>
30+
inline const bool __is_bounded_array_v = __is_bounded_array(_Tp);
31+
32+
#if _LIBCPP_STD_VER >= 20
33+
34+
template <class _Tp>
35+
struct _LIBCPP_NO_SPECIALIZATIONS is_bounded_array : bool_constant<__is_bounded_array(_Tp)> {};
36+
37+
template <class _Tp>
38+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
39+
40+
#endif
41+
42+
template <class _Tp>
43+
inline const bool __is_unbounded_array_v = __is_unbounded_array(_Tp);
44+
45+
#if _LIBCPP_STD_VER >= 20
46+
47+
template <class _Tp>
48+
struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array(_Tp)> {};
49+
50+
template <class _Tp>
51+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
52+
53+
#endif
54+
2955
_LIBCPP_END_NAMESPACE_STD
3056

3157
#endif // _LIBCPP___TYPE_TRAITS_IS_ARRAY_H

libcxx/include/__type_traits/is_bounded_array.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

libcxx/include/__type_traits/is_unbounded_array.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

libcxx/include/module.modulemap.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ module std_core [system] {
126126
header "__type_traits/is_base_of.h"
127127
export std_core.type_traits.integral_constant
128128
}
129-
module is_bounded_array {
130-
header "__type_traits/is_bounded_array.h"
131-
export std_core.type_traits.integral_constant
132-
}
133129
module is_callable {
134130
header "__type_traits/is_callable.h"
135131
export std_core.type_traits.integral_constant
@@ -323,10 +319,6 @@ module std_core [system] {
323319
header "__type_traits/is_trivially_relocatable.h"
324320
export std_core.type_traits.integral_constant
325321
}
326-
module is_unbounded_array {
327-
header "__type_traits/is_unbounded_array.h"
328-
export std_core.type_traits.integral_constant
329-
}
330322
module is_union {
331323
header "__type_traits/is_union.h"
332324
export std_core.type_traits.integral_constant

libcxx/include/optional

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ namespace std {
238238
# include <__type_traits/is_trivially_constructible.h>
239239
# include <__type_traits/is_trivially_destructible.h>
240240
# include <__type_traits/is_trivially_relocatable.h>
241-
# include <__type_traits/is_unbounded_array.h>
242241
# include <__type_traits/negation.h>
243242
# include <__type_traits/reference_constructs_from_temporary.h>
244243
# include <__type_traits/remove_const.h>

libcxx/include/type_traits

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,7 @@ namespace std
550550

551551
# if _LIBCPP_STD_VER >= 20
552552
# include <__type_traits/common_reference.h>
553-
# include <__type_traits/is_bounded_array.h>
554553
# include <__type_traits/is_constant_evaluated.h>
555-
# include <__type_traits/is_unbounded_array.h>
556554
# include <__type_traits/type_identity.h>
557555
# include <__type_traits/unwrap_ref.h>
558556
# endif

0 commit comments

Comments
 (0)