Skip to content

Commit b51bcad

Browse files
Attempt to expand std_core
... as `<type_traits>` might be included as a whole by `<cmath>`
1 parent 12604b6 commit b51bcad

File tree

4 files changed

+80
-68
lines changed

4 files changed

+80
-68
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@ set(files
780780
__tree
781781
__tuple/find_index.h
782782
__tuple/ignore.h
783-
__tuple/is_applicable.h
784783
__tuple/make_tuple_types.h
785784
__tuple/sfinae_helpers.h
786785
__tuple/tuple_element.h
@@ -820,6 +819,7 @@ set(files
820819
__type_traits/is_aggregate.h
821820
__type_traits/is_allocator.h
822821
__type_traits/is_always_bitcastable.h
822+
__type_traits/is_applicable.h
823823
__type_traits/is_arithmetic.h
824824
__type_traits/is_array.h
825825
__type_traits/is_assignable.h

libcxx/include/module.modulemap.in

Lines changed: 78 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@ module std_config [system] {
1212
}
1313

1414
module std_core [system] {
15+
// TODO: Investigate whether we should bring the whole <concepts> here.
16+
module concepts_core {
17+
module arithmetic { header "__concepts/arithmetic.h" }
18+
module assignable { header "__concepts/assignable.h" }
19+
module boolean_testable { header "__concepts/boolean_testable.h" }
20+
module class_or_enum { header "__concepts/class_or_enum.h" }
21+
module common_reference_with { header "__concepts/common_reference_with.h" }
22+
module constructible { header "__concepts/constructible.h" }
23+
module convertible_to { header "__concepts/convertible_to.h" }
24+
module copyable { header "__concepts/copyable.h" }
25+
module derived_from { header "__concepts/derived_from.h" }
26+
module destructible { header "__concepts/destructible.h" }
27+
module equality_comparable { header "__concepts/equality_comparable.h" }
28+
module invocable { header "__concepts/invocable.h" }
29+
module movable { header "__concepts/movable.h" }
30+
module predicate { header "__concepts/predicate.h" }
31+
module regular { header "__concepts/regular.h" }
32+
module relation { header "__concepts/relation.h" }
33+
module same_as { header "__concepts/same_as.h" }
34+
module semiregular { header "__concepts/semiregular.h" }
35+
module swappable { header "__concepts/swappable.h" }
36+
module totally_ordered { header "__concepts/totally_ordered.h" }
37+
}
38+
1539
module cstddef {
1640
module byte { header "__cstddef/byte.h" }
1741
module max_align_t {
@@ -28,11 +52,41 @@ module std_core [system] {
2852
export *
2953
}
3054

55+
module get_fwd {
56+
header "__fwd/get.h"
57+
export std_core.fwd.pair
58+
export std_core.fwd.tuple
59+
export std_core.fwd.array
60+
export std_core.fwd.complex
61+
export std_core.fwd.subrange
62+
export std_core.fwd.variant
63+
}
64+
3165
module fwd {
66+
module array { header "__fwd/array.h" }
67+
module complex { header "__fwd/complex.h" }
3268
module byte { header "__fwd/byte.h" }
3369
module functional { header "__fwd/functional.h" }
3470
module pair { header "__fwd/pair.h" }
71+
module subrange { header "__fwd/subrange.h" }
3572
module tuple { header "__fwd/tuple.h" }
73+
module variant { header "__fwd/variant.h" }
74+
}
75+
76+
// Only the truly dependency-free parts of __iterator are here
77+
module iterator_core {
78+
module concepts {
79+
header "__iterator/concepts.h"
80+
export std_core.type_traits.common_reference
81+
}
82+
module incrementable_traits { header "__iterator/incrementable_traits.h" }
83+
module iter_move { header "__iterator/iter_move.h" }
84+
module iterator_traits {
85+
header "__iterator/iterator_traits.h"
86+
export std_core.type_traits.integral_constant
87+
export std_core.type_traits.is_convertible
88+
}
89+
module readable_traits { header "__iterator/readable_traits.h" }
3690
}
3791

3892
module limits {
@@ -63,6 +117,21 @@ module std_core [system] {
63117
module trigonometric_functions { header "__math/trigonometric_functions.h" }
64118
}
65119

120+
// Only the truly dependency-free parts of __memory are here
121+
module memory_core {
122+
module addressof { header "__memory/addressof.h" }
123+
module pointer_traits { header "__memory/pointer_traits.h" }
124+
}
125+
126+
// Only the truly dependency-free parts of __tuple are here
127+
module tuple_core {
128+
module tuple_element { header "__tuple/tuple_element.h" }
129+
module tuple_like { header "__tuple/tuple_like.h" }
130+
module tuple_like_no_subrange { header "__tuple/tuple_like_no_subrange.h" }
131+
module tuple_size { header "__tuple/tuple_size.h" }
132+
module tuple_types { header "__tuple/tuple_types.h" }
133+
}
134+
66135
module type_traits {
67136
module add_cv_quals { header "__type_traits/add_cv_quals.h" }
68137
module add_pointer { header "__type_traits/add_pointer.h" }
@@ -112,6 +181,10 @@ module std_core [system] {
112181
header "__type_traits/is_always_bitcastable.h"
113182
export std_core.type_traits.integral_constant
114183
}
184+
module is_applicable {
185+
header "__type_traits/is_applicable.h"
186+
export std_core.type_traits.integral_constant
187+
}
115188
module is_arithmetic {
116189
header "__type_traits/is_arithmetic.h"
117190
export std_core.type_traits.integral_constant
@@ -393,9 +466,10 @@ module std_core [system] {
393466

394467
// Only the truly dependency-free parts of __utility are here
395468
module utility_core {
396-
module declval { header "__utility/declval.h" }
397-
module empty { header "__utility/empty.h" }
398-
module forward { header "__utility/forward.h" }
469+
module declval { header "__utility/declval.h" }
470+
module empty { header "__utility/empty.h" }
471+
module forward { header "__utility/forward.h" }
472+
module integer_sequence { header "__utility/integer_sequence.h" }
399473
}
400474
} // module std_core
401475

@@ -864,8 +938,6 @@ module std [system] {
864938
}
865939

866940
module array {
867-
module fwd { header "__fwd/array.h" }
868-
869941
header "array"
870942
export *
871943
export std.iterator.reverse_iterator
@@ -1056,35 +1128,13 @@ module std [system] {
10561128
}
10571129

10581130
module complex {
1059-
module fwd { header "__fwd/complex.h" }
1060-
10611131
header "complex"
10621132
export *
10631133
}
10641134

10651135
module concepts {
1066-
module arithmetic { header "__concepts/arithmetic.h" }
1067-
module assignable { header "__concepts/assignable.h" }
1068-
module boolean_testable { header "__concepts/boolean_testable.h" }
1069-
module class_or_enum { header "__concepts/class_or_enum.h" }
1070-
module common_reference_with { header "__concepts/common_reference_with.h" }
10711136
module common_with { header "__concepts/common_with.h" }
1072-
module constructible { header "__concepts/constructible.h" }
1073-
module convertible_to { header "__concepts/convertible_to.h" }
1074-
module copyable { header "__concepts/copyable.h" }
1075-
module derived_from { header "__concepts/derived_from.h" }
1076-
module destructible { header "__concepts/destructible.h" }
10771137
module different_from { header "__concepts/different_from.h" }
1078-
module equality_comparable { header "__concepts/equality_comparable.h" }
1079-
module invocable { header "__concepts/invocable.h" }
1080-
module movable { header "__concepts/movable.h" }
1081-
module predicate { header "__concepts/predicate.h" }
1082-
module regular { header "__concepts/regular.h" }
1083-
module relation { header "__concepts/relation.h" }
1084-
module same_as { header "__concepts/same_as.h" }
1085-
module semiregular { header "__concepts/semiregular.h" }
1086-
module swappable { header "__concepts/swappable.h" }
1087-
module totally_ordered { header "__concepts/totally_ordered.h" }
10881138

10891139
header "concepts"
10901140
export *
@@ -1494,10 +1544,6 @@ module std [system] {
14941544
module back_insert_iterator { header "__iterator/back_insert_iterator.h" }
14951545
module bounded_iter { header "__iterator/bounded_iter.h" }
14961546
module common_iterator { header "__iterator/common_iterator.h" }
1497-
module concepts {
1498-
header "__iterator/concepts.h"
1499-
export std_core.type_traits.common_reference
1500-
}
15011547
module counted_iterator { header "__iterator/counted_iterator.h" }
15021548
module cpp17_iterator_concepts { header "__iterator/cpp17_iterator_concepts.h" }
15031549
module data { header "__iterator/data.h" }
@@ -1506,21 +1552,14 @@ module std [system] {
15061552
module empty { header "__iterator/empty.h" }
15071553
module erase_if_container { header "__iterator/erase_if_container.h" }
15081554
module front_insert_iterator { header "__iterator/front_insert_iterator.h" }
1509-
module incrementable_traits { header "__iterator/incrementable_traits.h" }
15101555
module indirectly_comparable { header "__iterator/indirectly_comparable.h" }
15111556
module insert_iterator { header "__iterator/insert_iterator.h" }
15121557
module istream_iterator { header "__iterator/istream_iterator.h" }
15131558
module istreambuf_iterator {
15141559
header "__iterator/istreambuf_iterator.h"
15151560
export std.string.char_traits
15161561
}
1517-
module iter_move { header "__iterator/iter_move.h" }
15181562
module iter_swap { header "__iterator/iter_swap.h" }
1519-
module iterator_traits {
1520-
header "__iterator/iterator_traits.h"
1521-
export std_core.type_traits.integral_constant
1522-
export std_core.type_traits.is_convertible
1523-
}
15241563
module iterator_with_data { header "__iterator/iterator_with_data.h" }
15251564
module iterator { header "__iterator/iterator.h" }
15261565
module mergeable { header "__iterator/mergeable.h" }
@@ -1537,7 +1576,6 @@ module std [system] {
15371576
module product_iterator { header "__iterator/product_iterator.h" }
15381577
module projected { header "__iterator/projected.h" }
15391578
module ranges_iterator_traits { header "__iterator/ranges_iterator_traits.h" }
1540-
module readable_traits { header "__iterator/readable_traits.h" }
15411579
module reverse_access { header "__iterator/reverse_access.h" }
15421580
module reverse_iterator { header "__iterator/reverse_iterator.h" }
15431581
module segmented_iterator { header "__iterator/segmented_iterator.h" }
@@ -1631,7 +1669,6 @@ module std [system] {
16311669
}
16321670

16331671
module memory {
1634-
module addressof { header "__memory/addressof.h" }
16351672
module align { header "__memory/align.h" }
16361673
module aligned_alloc { header "__memory/aligned_alloc.h" }
16371674
module allocate_at_least { header "__memory/allocate_at_least.h" }
@@ -1656,7 +1693,6 @@ module std [system] {
16561693
module is_sufficiently_aligned { header "__memory/is_sufficiently_aligned.h" }
16571694
module noexcept_move_assign_container { header "__memory/noexcept_move_assign_container.h" }
16581695
module out_ptr { header "__memory/out_ptr.h" }
1659-
module pointer_traits { header "__memory/pointer_traits.h" }
16601696
module ranges_construct_at { header "__memory/ranges_construct_at.h" }
16611697
module ranges_destroy { header "__memory/ranges_destroy.h" }
16621698
module ranges_uninitialized_algorithms {
@@ -1913,10 +1949,7 @@ module std [system] {
19131949
}
19141950
module subrange {
19151951
header "__ranges/subrange.h"
1916-
export std.ranges.subrange_fwd
1917-
}
1918-
module subrange_fwd {
1919-
header "__fwd/subrange.h"
1952+
export std_core.fwd.subrange
19201953
}
19211954
module take_view {
19221955
header "__ranges/take_view.h"
@@ -2111,18 +2144,9 @@ module std [system] {
21112144
module tuple {
21122145
module find_index { header "__tuple/find_index.h" }
21132146
module ignore { header "__tuple/ignore.h" }
2114-
module is_applicable {
2115-
header "__tuple/is_applicable.h"
2116-
export std_core.type_traits.integral_constant
2117-
}
21182147
module make_tuple_types { header "__tuple/make_tuple_types.h" }
21192148
module sfinae_helpers { header "__tuple/sfinae_helpers.h" }
2120-
module tuple_element { header "__tuple/tuple_element.h" }
21212149
module tuple_like_ext { header "__tuple/tuple_like_ext.h" }
2122-
module tuple_like_no_subrange { header "__tuple/tuple_like_no_subrange.h" }
2123-
module tuple_like { header "__tuple/tuple_like.h" }
2124-
module tuple_size { header "__tuple/tuple_size.h" }
2125-
module tuple_types { header "__tuple/tuple_types.h" }
21262150

21272151
header "tuple"
21282152
export *
@@ -2167,7 +2191,6 @@ module std [system] {
21672191
header "__utility/in_place.h"
21682192
export std_core.type_traits.integral_constant
21692193
}
2170-
module integer_sequence { header "__utility/integer_sequence.h" }
21712194
module is_pointer_in_range { header "__utility/is_pointer_in_range.h" }
21722195
module is_valid_range { header "__utility/is_valid_range.h" }
21732196
module move { header "__utility/move.h" }
@@ -2193,7 +2216,6 @@ module std [system] {
21932216
}
21942217

21952218
module variant {
2196-
module fwd { header "__fwd/variant.h" }
21972219
module monostate { header "__variant/monostate.h" }
21982220

21992221
header "variant"
@@ -2270,16 +2292,6 @@ module std [system] {
22702292
module strict_weak_ordering_check { header "__debug_utils/strict_weak_ordering_check.h" }
22712293
}
22722294

2273-
module get_fwd {
2274-
header "__fwd/get.h"
2275-
export std_core.fwd.pair
2276-
export std_core.fwd.tuple
2277-
export std.array.fwd
2278-
export std.complex.fwd
2279-
export std.ranges.subrange_fwd
2280-
export std.variant.fwd
2281-
}
2282-
22832295
module pstl {
22842296
module backend_fwd {
22852297
header "__pstl/backend_fwd.h"

libcxx/include/type_traits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ namespace std
572572
# endif
573573

574574
# if _LIBCPP_STD_VER >= 26
575-
# include <__tuple/is_applicable.h>
575+
# include <__type_traits/is_applicable.h>
576576
# endif
577577

578578
# include <version>

0 commit comments

Comments
 (0)