@@ -250,27 +250,32 @@ operator==(const map<Key, T, Compare, Allocator>& x,
250
250
template <class Key, class T, class Compare, class Allocator>
251
251
bool
252
252
operator< (const map<Key, T, Compare, Allocator>& x,
253
- const map<Key, T, Compare, Allocator>& y);
253
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
254
254
255
255
template <class Key, class T, class Compare, class Allocator>
256
256
bool
257
257
operator!=(const map<Key, T, Compare, Allocator>& x,
258
- const map<Key, T, Compare, Allocator>& y);
258
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
259
259
260
260
template <class Key, class T, class Compare, class Allocator>
261
261
bool
262
262
operator> (const map<Key, T, Compare, Allocator>& x,
263
- const map<Key, T, Compare, Allocator>& y);
263
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
264
264
265
265
template <class Key, class T, class Compare, class Allocator>
266
266
bool
267
267
operator>=(const map<Key, T, Compare, Allocator>& x,
268
- const map<Key, T, Compare, Allocator>& y);
268
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
269
269
270
270
template <class Key, class T, class Compare, class Allocator>
271
271
bool
272
272
operator<=(const map<Key, T, Compare, Allocator>& x,
273
- const map<Key, T, Compare, Allocator>& y);
273
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
274
+
275
+ template<class Key, class T, class Compare, class Allocator>
276
+ synth-three-way-result<pair<const Key, T>>
277
+ operator<=>(const map<Key, T, Compare, Allocator>& x,
278
+ const map<Key, T, Compare, Allocator>& y); // since C++20
274
279
275
280
// specialized algorithms:
276
281
template <class Key, class T, class Compare, class Allocator>
@@ -491,27 +496,32 @@ operator==(const multimap<Key, T, Compare, Allocator>& x,
491
496
template <class Key, class T, class Compare, class Allocator>
492
497
bool
493
498
operator< (const multimap<Key, T, Compare, Allocator>& x,
494
- const multimap<Key, T, Compare, Allocator>& y);
499
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
495
500
496
501
template <class Key, class T, class Compare, class Allocator>
497
502
bool
498
503
operator!=(const multimap<Key, T, Compare, Allocator>& x,
499
- const multimap<Key, T, Compare, Allocator>& y);
504
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
500
505
501
506
template <class Key, class T, class Compare, class Allocator>
502
507
bool
503
508
operator> (const multimap<Key, T, Compare, Allocator>& x,
504
- const multimap<Key, T, Compare, Allocator>& y);
509
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
505
510
506
511
template <class Key, class T, class Compare, class Allocator>
507
512
bool
508
513
operator>=(const multimap<Key, T, Compare, Allocator>& x,
509
- const multimap<Key, T, Compare, Allocator>& y);
514
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
510
515
511
516
template <class Key, class T, class Compare, class Allocator>
512
517
bool
513
518
operator<=(const multimap<Key, T, Compare, Allocator>& x,
514
- const multimap<Key, T, Compare, Allocator>& y);
519
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
520
+
521
+ template<class Key, class T, class Compare, class Allocator>
522
+ synth-three-way-result<pair<const Key, T>>
523
+ operator<=>(const multimap<Key, T, Compare, Allocator>& x,
524
+ const multimap<Key, T, Compare, Allocator>& y); // since c++20
515
525
516
526
// specialized algorithms:
517
527
template <class Key, class T, class Compare, class Allocator>
@@ -530,6 +540,7 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
530
540
531
541
#include < __algorithm/equal.h>
532
542
#include < __algorithm/lexicographical_compare.h>
543
+ #include < __algorithm/lexicographical_compare_three_way.h>
533
544
#include < __assert> // all public C++ headers provide the assertion handler
534
545
#include < __config>
535
546
#include < __functional/binary_function.h>
@@ -1676,6 +1687,8 @@ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x,
1676
1687
return __x.size () == __y.size () && _VSTD::equal (__x.begin (), __x.end (), __y.begin ());
1677
1688
}
1678
1689
1690
+ #if _LIBCPP_STD_VER <= 17
1691
+
1679
1692
template <class _Key , class _Tp , class _Compare , class _Allocator >
1680
1693
inline _LIBCPP_INLINE_VISIBILITY
1681
1694
bool
@@ -1721,6 +1734,20 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
1721
1734
return !(__y < __x);
1722
1735
}
1723
1736
1737
+ #else // #if _LIBCPP_STD_VER <= 17
1738
+
1739
+ template <class _Key , class _Tp , class _Compare , class _Allocator >
1740
+ inline _LIBCPP_HIDE_FROM_ABI
1741
+ __synth_three_way_result<pair<const _Key, _Tp>>
1742
+ operator <=>(const map<_Key, _Tp, _Compare, _Allocator>& __x,
1743
+ const map<_Key, _Tp, _Compare, _Allocator>& __y)
1744
+ {
1745
+ return std::lexicographical_compare_three_way (
1746
+ __x.begin (), __x.end (), __y.begin (), __y.end (), __synth_three_way);
1747
+ }
1748
+
1749
+ #endif // #if _LIBCPP_STD_VER <= 17
1750
+
1724
1751
template <class _Key , class _Tp , class _Compare , class _Allocator >
1725
1752
inline _LIBCPP_INLINE_VISIBILITY
1726
1753
void
@@ -2270,6 +2297,8 @@ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
2270
2297
return __x.size () == __y.size () && _VSTD::equal (__x.begin (), __x.end (), __y.begin ());
2271
2298
}
2272
2299
2300
+ #if _LIBCPP_STD_VER <= 17
2301
+
2273
2302
template <class _Key , class _Tp , class _Compare , class _Allocator >
2274
2303
inline _LIBCPP_INLINE_VISIBILITY
2275
2304
bool
@@ -2315,6 +2344,20 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
2315
2344
return !(__y < __x);
2316
2345
}
2317
2346
2347
+ #else // #if _LIBCPP_STD_VER <= 17
2348
+
2349
+ template <class _Key , class _Tp , class _Compare , class _Allocator >
2350
+ inline _LIBCPP_HIDE_FROM_ABI
2351
+ __synth_three_way_result<pair<const _Key, _Tp>>
2352
+ operator <=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
2353
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
2354
+ {
2355
+ return std::lexicographical_compare_three_way (
2356
+ __x.begin (), __x.end (), __y.begin (), __y.end (), __synth_three_way);
2357
+ }
2358
+
2359
+ #endif // #if _LIBCPP_STD_VER <= 17
2360
+
2318
2361
template <class _Key , class _Tp , class _Compare , class _Allocator >
2319
2362
inline _LIBCPP_INLINE_VISIBILITY
2320
2363
void
0 commit comments