Skip to content

Commit c4d6003

Browse files
committed
update
1 parent c85a28a commit c4d6003

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
@@ -1296,6 +1296,7 @@ module std [system] {
12961296

12971297
header "flat_set"
12981298
export std.flat_map.sorted_unique
1299+
export std.flat_map.sorted_equivalent
12991300
export *
13001301
}
13011302

libcxx/include/version

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

5130-
# if !defined(_LIBCPP_VERSION)
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"
5136-
# endif
5137-
# else // _LIBCPP_VERSION
5138-
# ifdef __cpp_lib_flat_set
5139-
# error "__cpp_lib_flat_set should not be defined because it is unimplemented in libc++!"
5140-
# endif
5130+
# ifndef __cpp_lib_flat_set
5131+
# error "__cpp_lib_flat_set should be defined in c++23"
5132+
# endif
5133+
# if __cpp_lib_flat_set != 202207L
5134+
# error "__cpp_lib_flat_set should have the value 202207L in c++23"
51415135
# endif
51425136

51435137
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
@@ -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
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT

0 commit comments

Comments
 (0)