Skip to content

Commit da0281d

Browse files
committed
update
1 parent 5c734e1 commit da0281d

File tree

11 files changed

+913
-51
lines changed

11 files changed

+913
-51
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ Status
332332
---------------------------------------------------------- -----------------
333333
``__cpp_lib_flat_map`` ``202207L``
334334
---------------------------------------------------------- -----------------
335-
``__cpp_lib_flat_set`` *unimplemented*
335+
``__cpp_lib_flat_set`` ``202207L``
336336
---------------------------------------------------------- -----------------
337337
``__cpp_lib_format_ranges`` ``202207L``
338338
---------------------------------------------------------- -----------------

libcxx/docs/Status/Cxx23Papers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"`P0009R18 <https://wg21.link/P0009R18>`__","mdspan: A Non-Owning Multidimensional Array Reference","2022-07 (Virtual)","|Complete|","18",""
5555
"`P0429R9 <https://wg21.link/P0429R9>`__","A Standard ``flat_map``","2022-07 (Virtual)","|Complete|","20",""
5656
"`P1169R4 <https://wg21.link/P1169R4>`__","``static operator()``","2022-07 (Virtual)","|Complete|","16",""
57-
"`P1222R4 <https://wg21.link/P1222R4>`__","A Standard ``flat_set``","2022-07 (Virtual)","|In progress|","",""
57+
"`P1222R4 <https://wg21.link/P1222R4>`__","A Standard ``flat_set``","2022-07 (Virtual)","|Complete|","21",""
5858
"`P1223R5 <https://wg21.link/P1223R5>`__","``ranges::find_last()``, ``ranges::find_last_if()``, and ``ranges::find_last_if_not()``","2022-07 (Virtual)","|Complete|","19",""
5959
"`P1467R9 <https://wg21.link/P1467R9>`__","Extended ``floating-point`` types and standard names","2022-07 (Virtual)","","",""
6060
"`P1642R11 <https://wg21.link/P1642R11>`__","Freestanding ``[utilities]``, ``[ranges]``, and ``[iterators]``","2022-07 (Virtual)","","",""

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ set(files
368368
__flat_map/sorted_unique.h
369369
__flat_map/utils.h
370370
__flat_set/flat_set.h
371+
__flat_set/flat_multiset.h
371372
__format/buffer.h
372373
__format/concepts.h
373374
__format/container_adaptor.h

libcxx/include/__flat_set/flat_multiset.h

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/include/flat_set

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ namespace std {
3131
template<class Key, class Compare, class KeyContainer, class Predicate>
3232
typename flat_set<Key, Compare, KeyContainer>::size_type
3333
erase_if(flat_set<Key, Compare, KeyContainer>& c, Predicate pred);
34+
35+
// [flat.multiset], class template flat_multiset
36+
template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>
37+
class flat_multiset;
38+
39+
struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };
40+
inline constexpr sorted_equivalent_t sorted_equivalent{};
41+
42+
template<class Key, class Compare, class KeyContainer, class Allocator>
43+
struct uses_allocator<flat_multiset<Key, Compare, KeyContainer>, Allocator>;
44+
45+
// [flat.multiset.erasure], erasure for flat_multiset
46+
template<class Key, class Compare, class KeyContainer, class Predicate>
47+
typename flat_multiset<Key, Compare, KeyContainer>::size_type
48+
erase_if(flat_multiset<Key, Compare, KeyContainer>& c, Predicate pred);
3449
}
3550
*/
3651

@@ -41,7 +56,9 @@ namespace std {
4156

4257
# if _LIBCPP_STD_VER >= 23
4358
# include <__flat_map/sorted_unique.h>
59+
# include <__flat_map/sorted_equivalent.h>
4460
# include <__flat_set/flat_set.h>
61+
# include <__flat_set/flat_multiset.h>
4562
# endif
4663

4764
// for feature-test macros

libcxx/include/module.modulemap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,13 +1269,23 @@ module std [system] {
12691269
export std.vector.vector
12701270
export std.vector.fwd
12711271
}
1272+
module flat_multiset {
1273+
header "__flat_set/flat_multiset.h"
1274+
export std.vector.vector
1275+
export std.vector.fwd
1276+
}
12721277
module sorted_unique {
12731278
header "__flat_map/sorted_unique.h"
12741279
export *
12751280
}
1281+
module sorted_equivalent {
1282+
header "__flat_map/sorted_equivalent.h"
1283+
export *
1284+
}
12761285

12771286
header "flat_set"
12781287
export std.flat_map.sorted_unique
1288+
export std.flat_map.sorted_equivalent
12791289
export *
12801290
}
12811291

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ __cpp_lib_void_t 201411L <type_traits>
483483
# define __cpp_lib_containers_ranges 202202L
484484
# define __cpp_lib_expected 202211L
485485
# define __cpp_lib_flat_map 202207L
486-
// # define __cpp_lib_flat_set 202207L
486+
# define __cpp_lib_flat_set 202207L
487487
# define __cpp_lib_format_ranges 202207L
488488
// # define __cpp_lib_formatters 202302L
489489
# define __cpp_lib_forward_like 202207L

libcxx/modules/std/flat_set.inc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ export namespace std {
1919

2020
// [flat.set.erasure], erasure for flat_­set
2121
using std::erase_if;
22-
#endif // _LIBCPP_STD_VER >= 23
2322

24-
#if 0
2523
// [flat.multiset], class template flat_­multiset
2624
using std::flat_multiset;
2725

2826
using std::sorted_equivalent;
2927
using std::sorted_equivalent_t;
30-
#endif
28+
#endif // _LIBCPP_STD_VER >= 23
3129
} // namespace std

libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,20 @@
4848

4949
#elif TEST_STD_VER == 23
5050

51-
# if !defined(_LIBCPP_VERSION)
52-
# ifndef __cpp_lib_flat_set
53-
# error "__cpp_lib_flat_set should be defined in c++23"
54-
# endif
55-
# if __cpp_lib_flat_set != 202207L
56-
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
57-
# endif
58-
# else // _LIBCPP_VERSION
59-
# ifdef __cpp_lib_flat_set
60-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
61-
# endif
51+
# ifndef __cpp_lib_flat_set
52+
# error "__cpp_lib_flat_set should be defined in c++23"
53+
# endif
54+
# if __cpp_lib_flat_set != 202207L
55+
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
6256
# endif
6357

6458
#elif TEST_STD_VER > 23
6559

66-
# if !defined(_LIBCPP_VERSION)
67-
# ifndef __cpp_lib_flat_set
68-
# error "__cpp_lib_flat_set should be defined in c++26"
69-
# endif
70-
# if __cpp_lib_flat_set != 202207L
71-
# error "__cpp_lib_flat_set should have the value 202207L in c++26"
72-
# endif
73-
# else // _LIBCPP_VERSION
74-
# ifdef __cpp_lib_flat_set
75-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
76-
# endif
60+
# ifndef __cpp_lib_flat_set
61+
# error "__cpp_lib_flat_set should be defined in c++26"
62+
# endif
63+
# if __cpp_lib_flat_set != 202207L
64+
# error "__cpp_lib_flat_set should have the value 202207L in c++26"
7765
# endif
7866

7967
#endif // TEST_STD_VER > 23

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5133,17 +5133,11 @@
51335133
# error "__cpp_lib_flat_map should have the value 202207L in c++23"
51345134
# endif
51355135

5136-
# if !defined(_LIBCPP_VERSION)
5137-
# ifndef __cpp_lib_flat_set
5138-
# error "__cpp_lib_flat_set should be defined in c++23"
5139-
# endif
5140-
# if __cpp_lib_flat_set != 202207L
5141-
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
5142-
# endif
5143-
# else // _LIBCPP_VERSION
5144-
# ifdef __cpp_lib_flat_set
5145-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
5146-
# endif
5136+
# ifndef __cpp_lib_flat_set
5137+
# error "__cpp_lib_flat_set should be defined in c++23"
5138+
# endif
5139+
# if __cpp_lib_flat_set != 202207L
5140+
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
51475141
# endif
51485142

51495143
# ifndef __cpp_lib_format
@@ -6840,17 +6834,11 @@
68406834
# error "__cpp_lib_flat_map should have the value 202207L in c++26"
68416835
# endif
68426836

6843-
# if !defined(_LIBCPP_VERSION)
6844-
# ifndef __cpp_lib_flat_set
6845-
# error "__cpp_lib_flat_set should be defined in c++26"
6846-
# endif
6847-
# if __cpp_lib_flat_set != 202207L
6848-
# error "__cpp_lib_flat_set should have the value 202207L in c++26"
6849-
# endif
6850-
# else // _LIBCPP_VERSION
6851-
# ifdef __cpp_lib_flat_set
6852-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
6853-
# endif
6837+
# ifndef __cpp_lib_flat_set
6838+
# error "__cpp_lib_flat_set should be defined in c++26"
6839+
# endif
6840+
# if __cpp_lib_flat_set != 202207L
6841+
# error "__cpp_lib_flat_set should have the value 202207L in c++26"
68546842
# endif
68556843

68566844
# ifndef __cpp_lib_format

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ def add_version_header(tc):
514514
"name": "__cpp_lib_flat_set",
515515
"values": {"c++23": 202207},
516516
"headers": ["flat_set"],
517-
"unimplemented": True,
518517
},
519518
{
520519
"name": "__cpp_lib_format",

0 commit comments

Comments
 (0)