Skip to content

Commit 889b8c8

Browse files
ahanamukCaseyCarterStephanTLavavej
authored
feature/spaceship: Clause 22: Containers (#1046)
Co-authored-by: Casey Carter <[email protected]> Co-authored-by: Stephan T. Lavavej <[email protected]>
1 parent de04d41 commit 889b8c8

File tree

18 files changed

+809
-120
lines changed

18 files changed

+809
-120
lines changed

stl/inc/array

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,17 +775,41 @@ _CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noex
775775

776776
template <class _Ty, size_t _Size>
777777
_NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
778+
#ifdef __EDG__ // TRANSITION, VSO-1161663
778779
return _STD equal(_Left.begin(), _Left.end(), _Right.begin());
780+
#else // ^^^ workaround / no workaround vvv
781+
return _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
782+
#endif // ^^^ no workaround ^^^
779783
}
780784

785+
#if !_HAS_CXX20
781786
template <class _Ty, size_t _Size>
782787
_NODISCARD _CONSTEXPR20 bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
783788
return !(_Left == _Right);
784789
}
790+
#endif // !_HAS_CXX20
785791

792+
#ifdef __cpp_lib_concepts
793+
template <class _Ty, size_t _Size>
794+
_NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>(
795+
const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
796+
#ifdef __EDG__ // TRANSITION, VSO-1161663
797+
return _STD lexicographical_compare_three_way(
798+
_Left.begin(), _Left.end(), _Right.begin(), _Right.end(), _Synth_three_way{});
799+
#else // ^^^ workaround / no workaround vvv
800+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
801+
_Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
802+
#endif // ^^^ no workaround ^^^
803+
}
804+
#else // __cpp_lib_concepts
786805
template <class _Ty, size_t _Size>
787806
_NODISCARD _CONSTEXPR20 bool operator<(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
807+
#ifdef __EDG__ // TRANSITION, VSO-1161663
788808
return _STD lexicographical_compare(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
809+
#else // ^^^ workaround / no workaround vvv
810+
return _STD lexicographical_compare(
811+
_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end());
812+
#endif // ^^^ no workaround ^^^
789813
}
790814

791815
template <class _Ty, size_t _Size>
@@ -802,6 +826,7 @@ template <class _Ty, size_t _Size>
802826
_NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
803827
return !(_Left < _Right);
804828
}
829+
#endif // __cpp_lib_concepts
805830

806831
#if _HAS_CXX20
807832
// FUNCTION TEMPLATE to_array

stl/inc/deque

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,11 +1581,20 @@ _NODISCARD bool operator==(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Al
15811581
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
15821582
}
15831583

1584+
#if !_HAS_CXX20
15841585
template <class _Ty, class _Alloc>
15851586
_NODISCARD bool operator!=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
15861587
return !(_Left == _Right);
15871588
}
1589+
#endif // !_HAS_CXX20
15881590

1591+
#ifdef __cpp_lib_concepts
1592+
template <class _Ty, class _Alloc>
1593+
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
1594+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
1595+
_Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
1596+
}
1597+
#else // __cpp_lib_concepts
15891598
template <class _Ty, class _Alloc>
15901599
_NODISCARD bool operator<(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
15911600
return _STD lexicographical_compare(
@@ -1606,6 +1615,7 @@ template <class _Ty, class _Alloc>
16061615
_NODISCARD bool operator>=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) {
16071616
return !(_Left < _Right);
16081617
}
1618+
#endif // __cpp_lib_concepts
16091619

16101620
#if _HAS_CXX20
16111621
template <class _Ty, class _Alloc, class _Uty>

stl/inc/forward_list

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,10 @@ public:
814814
return {};
815815
}
816816

817+
_Unchecked_const_iterator _Unchecked_end_iter() const noexcept {
818+
return _Unchecked_const_iterator(nullptr, nullptr);
819+
}
820+
817821
iterator _Make_iter(_Nodeptr _Where) const noexcept {
818822
return iterator(_Where, _STD addressof(_Mypair._Myval2));
819823
}
@@ -1518,17 +1522,29 @@ void swap(forward_list<_Ty, _Alloc>& _Left, forward_list<_Ty, _Alloc>& _Right) n
15181522

15191523
template <class _Ty, class _Alloc>
15201524
_NODISCARD bool operator==(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
1521-
return _STD equal(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
1525+
return _STD equal(
1526+
_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin(), _Right._Unchecked_end_iter());
15221527
}
15231528

1529+
#if !_HAS_CXX20
15241530
template <class _Ty, class _Alloc>
15251531
_NODISCARD bool operator!=(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
15261532
return !(_Left == _Right);
15271533
}
1534+
#endif // !_HAS_CXX20
15281535

1536+
#ifdef __cpp_lib_concepts
1537+
template <class _Ty, class _Alloc>
1538+
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(
1539+
const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
1540+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
1541+
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
1542+
}
1543+
#else // __cpp_lib_concepts
15291544
template <class _Ty, class _Alloc>
15301545
_NODISCARD bool operator<(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
1531-
return _STD lexicographical_compare(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
1546+
return _STD lexicographical_compare(
1547+
_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin(), _Right._Unchecked_end_iter());
15321548
}
15331549

15341550
template <class _Ty, class _Alloc>
@@ -1545,6 +1561,7 @@ template <class _Ty, class _Alloc>
15451561
_NODISCARD bool operator>=(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) {
15461562
return !(_Left < _Right);
15471563
}
1564+
#endif // __cpp_lib_concepts
15481565

15491566
#if _HAS_CXX20
15501567
template <class _Ty, class _Alloc, class _Uty>

stl/inc/list

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,17 +1807,28 @@ void swap(list<_Ty, _Alloc>& _Left, list<_Ty, _Alloc>& _Right) noexcept /* stren
18071807

18081808
template <class _Ty, class _Alloc>
18091809
_NODISCARD bool operator==(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
1810-
return _Left.size() == _Right.size() && _STD equal(_Left.begin(), _Left.end(), _Right.begin());
1810+
return _Left.size() == _Right.size()
1811+
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
18111812
}
18121813

1814+
#if !_HAS_CXX20
18131815
template <class _Ty, class _Alloc>
18141816
_NODISCARD bool operator!=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
18151817
return !(_Left == _Right);
18161818
}
1819+
#endif // !_HAS_CXX20
18171820

1821+
#ifdef __cpp_lib_concepts
1822+
template <class _Ty, class _Alloc>
1823+
_NODISCARD _Synth_three_way_result<_Ty> operator<=>(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
1824+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
1825+
_Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
1826+
}
1827+
#else // __cpp_lib_concepts
18181828
template <class _Ty, class _Alloc>
18191829
_NODISCARD bool operator<(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
1820-
return _STD lexicographical_compare(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
1830+
return _STD lexicographical_compare(
1831+
_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end());
18211832
}
18221833

18231834
template <class _Ty, class _Alloc>
@@ -1834,6 +1845,7 @@ template <class _Ty, class _Alloc>
18341845
_NODISCARD bool operator>=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) {
18351846
return !(_Left < _Right);
18361847
}
1848+
#endif // __cpp_lib_concepts
18371849

18381850
#if _HAS_CXX20
18391851
template <class _Ty, class _Alloc, class _Uty>

stl/inc/map

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,21 @@ _NODISCARD bool operator==(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_
369369
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
370370
}
371371

372+
#if !_HAS_CXX20
372373
template <class _Kty, class _Ty, class _Pr, class _Alloc>
373374
_NODISCARD bool operator!=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
374375
return !(_Left == _Right);
375376
}
377+
#endif // !_HAS_CXX20
376378

379+
#ifdef __cpp_lib_concepts
380+
template <class _Kty, class _Ty, class _Pr, class _Alloc>
381+
_NODISCARD _Synth_three_way_result<pair<const _Kty, _Ty>> operator<=>(
382+
const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
383+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
384+
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
385+
}
386+
#else // __cpp_lib_concepts
377387
template <class _Kty, class _Ty, class _Pr, class _Alloc>
378388
_NODISCARD bool operator<(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
379389
return _STD lexicographical_compare(
@@ -394,6 +404,7 @@ template <class _Kty, class _Ty, class _Pr, class _Alloc>
394404
_NODISCARD bool operator>=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) {
395405
return !(_Left < _Right);
396406
}
407+
#endif // __cpp_lib_concepts
397408

398409
template <class _Kty, class _Ty, class _Pr, class _Alloc>
399410
void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left, map<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept(
@@ -557,12 +568,22 @@ _NODISCARD bool operator==(
557568
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
558569
}
559570

571+
#if !_HAS_CXX20
560572
template <class _Kty, class _Ty, class _Pr, class _Alloc>
561573
_NODISCARD bool operator!=(
562574
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
563575
return !(_Left == _Right);
564576
}
577+
#endif // !_HAS_CXX20
565578

579+
#ifdef __cpp_lib_concepts
580+
template <class _Kty, class _Ty, class _Pr, class _Alloc>
581+
_NODISCARD _Synth_three_way_result<pair<const _Kty, _Ty>> operator<=>(
582+
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
583+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
584+
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
585+
}
586+
#else // __cpp_lib_concepts
566587
template <class _Kty, class _Ty, class _Pr, class _Alloc>
567588
_NODISCARD bool operator<(
568589
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
@@ -587,6 +608,7 @@ _NODISCARD bool operator>=(
587608
const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) {
588609
return !(_Left < _Right);
589610
}
611+
#endif // __cpp_lib_concepts
590612

591613
template <class _Kty, class _Ty, class _Pr, class _Alloc>
592614
void swap(multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept(

stl/inc/queue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ _NODISCARD bool operator>=(const queue<_Ty, _Container>& _Left, const queue<_Ty,
5454
return _Left.c >= _Right.c;
5555
}
5656

57+
#ifdef __cpp_lib_concepts
58+
template <class _Ty, three_way_comparable _Container>
59+
_NODISCARD compare_three_way_result_t<_Container> operator<=>(
60+
const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) {
61+
return _Left.c <=> _Right.c;
62+
}
63+
#endif // __cpp_lib_concepts
64+
5765
template <class _Ty, class _Container>
5866
class queue {
5967
public:
@@ -148,6 +156,11 @@ public:
148156
friend bool operator> <>(const queue&, const queue&);
149157
friend bool operator<= <>(const queue&, const queue&);
150158
friend bool operator>= <>(const queue&, const queue&);
159+
#ifdef __cpp_lib_concepts
160+
template <class _Ty2, three_way_comparable _Container2>
161+
friend compare_three_way_result_t<_Container2> operator<=>(
162+
const queue<_Ty2, _Container2>&, const queue<_Ty2, _Container2>&);
163+
#endif // __cpp_lib_concepts
151164
// clang-format on
152165

153166
protected:

stl/inc/set

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,21 @@ _NODISCARD bool operator==(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty,
180180
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
181181
}
182182

183+
#if !_HAS_CXX20
183184
template <class _Kty, class _Pr, class _Alloc>
184185
_NODISCARD bool operator!=(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
185186
return !(_Left == _Right);
186187
}
188+
#endif // !_HAS_CXX20
187189

190+
#ifdef __cpp_lib_concepts
191+
template <class _Kty, class _Pr, class _Alloc>
192+
_NODISCARD _Synth_three_way_result<_Kty> operator<=>(
193+
const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
194+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
195+
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
196+
}
197+
#else // __cpp_lib_concepts
188198
template <class _Kty, class _Pr, class _Alloc>
189199
_NODISCARD bool operator<(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
190200
return _STD lexicographical_compare(
@@ -205,6 +215,7 @@ template <class _Kty, class _Pr, class _Alloc>
205215
_NODISCARD bool operator>=(const set<_Kty, _Pr, _Alloc>& _Left, const set<_Kty, _Pr, _Alloc>& _Right) {
206216
return !(_Left < _Right);
207217
}
218+
#endif // __cpp_lib_concepts
208219

209220
template <class _Kty, class _Pr, class _Alloc>
210221
void swap(set<_Kty, _Pr, _Alloc>& _Left, set<_Kty, _Pr, _Alloc>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
@@ -352,11 +363,21 @@ _NODISCARD bool operator==(const multiset<_Kty, _Pr, _Alloc>& _Left, const multi
352363
&& _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin());
353364
}
354365

366+
#if !_HAS_CXX20
355367
template <class _Kty, class _Pr, class _Alloc>
356368
_NODISCARD bool operator!=(const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
357369
return !(_Left == _Right);
358370
}
371+
#endif // !_HAS_CXX20
359372

373+
#ifdef __cpp_lib_concepts
374+
template <class _Kty, class _Pr, class _Alloc>
375+
_NODISCARD _Synth_three_way_result<_Kty> operator<=>(
376+
const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
377+
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(),
378+
_Right._Unchecked_begin(), _Right._Unchecked_end_iter(), _Synth_three_way{});
379+
}
380+
#else // __cpp_lib_concepts
360381
template <class _Kty, class _Pr, class _Alloc>
361382
_NODISCARD bool operator<(const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
362383
return _STD lexicographical_compare(
@@ -377,6 +398,7 @@ template <class _Kty, class _Pr, class _Alloc>
377398
_NODISCARD bool operator>=(const multiset<_Kty, _Pr, _Alloc>& _Left, const multiset<_Kty, _Pr, _Alloc>& _Right) {
378399
return !(_Left < _Right);
379400
}
401+
#endif // __cpp_lib_concepts
380402

381403
template <class _Kty, class _Pr, class _Alloc>
382404
void swap(multiset<_Kty, _Pr, _Alloc>& _Left, multiset<_Kty, _Pr, _Alloc>& _Right) noexcept(

stl/inc/stack

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ _NODISCARD bool operator>=(const stack<_Ty, _Container>& _Left, const stack<_Ty,
5252
return _Left.c >= _Right.c;
5353
}
5454

55+
#ifdef __cpp_lib_concepts
56+
template <class _Ty, three_way_comparable _Container>
57+
_NODISCARD compare_three_way_result_t<_Container> operator<=>(
58+
const stack<_Ty, _Container>& _Left, const stack<_Ty, _Container>& _Right) {
59+
return _Left.c <=> _Right.c;
60+
}
61+
#endif // __cpp_lib_concepts
62+
5563
template <class _Ty, class _Container>
5664
class stack {
5765
public:
@@ -138,6 +146,11 @@ public:
138146
friend bool operator> <>(const stack&, const stack&);
139147
friend bool operator<= <>(const stack&, const stack&);
140148
friend bool operator>= <>(const stack&, const stack&);
149+
#ifdef __cpp_lib_concepts
150+
template <class _Ty2, three_way_comparable _Container2>
151+
friend compare_three_way_result_t<_Container2> operator<=>(
152+
const stack<_Ty2, _Container2>&, const stack<_Ty2, _Container2>&);
153+
#endif // __cpp_lib_concepts
141154
// clang-format on
142155

143156
protected:

stl/inc/unordered_map

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,13 @@ _NODISCARD bool operator==(const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Allo
468468
return _Hash_equal(_Left, _Right);
469469
}
470470

471+
#if !_HAS_CXX20
471472
template <class _Kty, class _Ty, class _Hasher, class _Keyeq, class _Alloc>
472473
_NODISCARD bool operator!=(const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Left,
473474
const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Right) {
474475
return !(_Left == _Right);
475476
}
477+
#endif // !_HAS_CXX20
476478

477479
// CLASS TEMPLATE unordered_multimap
478480
template <class _Kty, class _Ty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>,
@@ -758,11 +760,13 @@ _NODISCARD bool operator==(const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq,
758760
return _Hash_equal(_Left, _Right);
759761
}
760762

763+
#if !_HAS_CXX20
761764
template <class _Kty, class _Ty, class _Hasher, class _Keyeq, class _Alloc>
762765
_NODISCARD bool operator!=(const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Left,
763766
const unordered_multimap<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Right) {
764767
return !(_Left == _Right);
765768
}
769+
#endif // !_HAS_CXX20
766770

767771
#if _HAS_TR1_NAMESPACE
768772
namespace _DEPRECATE_TR1_NAMESPACE tr1 {

stl/inc/unordered_set

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,13 @@ _NODISCARD bool operator==(const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _
322322
return _Hash_equal(_Left, _Right);
323323
}
324324

325+
#if !_HAS_CXX20
325326
template <class _Kty, class _Hasher, class _Keyeq, class _Alloc>
326327
_NODISCARD bool operator!=(const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Left,
327328
const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) {
328329
return !(_Left == _Right);
329330
}
331+
#endif // !_HAS_CXX20
330332

331333
// CLASS TEMPLATE unordered_multiset
332334
template <class _Kty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>, class _Alloc = allocator<_Kty>>
@@ -584,11 +586,13 @@ _NODISCARD bool operator==(const unordered_multiset<_Kty, _Hasher, _Keyeq, _Allo
584586
return _Hash_equal(_Left, _Right);
585587
}
586588

589+
#if !_HAS_CXX20
587590
template <class _Kty, class _Hasher, class _Keyeq, class _Alloc>
588591
_NODISCARD bool operator!=(const unordered_multiset<_Kty, _Hasher, _Keyeq, _Alloc>& _Left,
589592
const unordered_multiset<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) {
590593
return !(_Left == _Right);
591594
}
595+
#endif // !_HAS_CXX20
592596

593597
#if _HAS_TR1_NAMESPACE
594598
namespace _DEPRECATE_TR1_NAMESPACE tr1 {

0 commit comments

Comments
 (0)