Skip to content

Commit 60192d5

Browse files
committed
update
1 parent 26c350c commit 60192d5

File tree

11 files changed

+904
-51
lines changed

11 files changed

+904
-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
@@ -369,6 +369,7 @@ set(files
369369
__flat_map/sorted_equivalent.h
370370
__flat_map/sorted_unique.h
371371
__flat_map/utils.h
372+
__flat_set/flat_multiset.h
372373
__flat_set/flat_set.h
373374
__flat_set/ra_iterator.h
374375
__format/buffer.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ module std [system] {
13061306

13071307
header "flat_set"
13081308
export std.flat_map.sorted_unique
1309+
export std.flat_map.sorted_equivalent
13091310
export *
13101311
}
13111312

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ __cpp_lib_void_t 201411L <type_traits>
486486
# define __cpp_lib_containers_ranges 202202L
487487
# define __cpp_lib_expected 202211L
488488
# define __cpp_lib_flat_map 202207L
489-
// # define __cpp_lib_flat_set 202207L
489+
# define __cpp_lib_flat_set 202207L
490490
# define __cpp_lib_format_ranges 202207L
491491
// # define __cpp_lib_formatters 202302L
492492
# 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
@@ -5128,17 +5128,11 @@
51285128
# error "__cpp_lib_flat_map should have the value 202207L in c++23"
51295129
# endif
51305130

5131-
# if !defined(_LIBCPP_VERSION)
5132-
# ifndef __cpp_lib_flat_set
5133-
# error "__cpp_lib_flat_set should be defined in c++23"
5134-
# endif
5135-
# if __cpp_lib_flat_set != 202207L
5136-
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
5137-
# endif
5138-
# else // _LIBCPP_VERSION
5139-
# ifdef __cpp_lib_flat_set
5140-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
5141-
# endif
5131+
# ifndef __cpp_lib_flat_set
5132+
# error "__cpp_lib_flat_set should be defined in c++23"
5133+
# endif
5134+
# if __cpp_lib_flat_set != 202207L
5135+
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
51425136
# endif
51435137

51445138
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
@@ -6841,17 +6835,11 @@
68416835
# error "__cpp_lib_flat_map should have the value 202207L in c++26"
68426836
# endif
68436837

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

68576845
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,6 @@ def add_version_header(tc):
520520
"name": "__cpp_lib_flat_set",
521521
"values": {"c++23": 202207},
522522
"headers": ["flat_set"],
523-
"unimplemented": True,
524523
},
525524
{
526525
"name": "__cpp_lib_format",

0 commit comments

Comments
 (0)