@@ -279,10 +279,18 @@ public:
279
279
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Container& __get_container () const { return c; }
280
280
281
281
template <class _T1 , class _OtherContainer >
282
- friend bool operator ==(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
282
+ friend _LIBCPP_HIDE_FROM_ABI bool
283
+ operator ==(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
283
284
284
285
template <class _T1 , class _OtherContainer >
285
- friend bool operator <(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
286
+ friend _LIBCPP_HIDE_FROM_ABI bool
287
+ operator <(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
288
+
289
+ # if _LIBCPP_STD_VER >= 20
290
+ template <class _T1 , three_way_comparable _OtherContainer>
291
+ friend _LIBCPP_HIDE_FROM_ABI compare_three_way_result_t <_OtherContainer>
292
+ operator <=>(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
293
+ # endif
286
294
};
287
295
288
296
# if _LIBCPP_STD_VER >= 17
@@ -353,8 +361,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const stack<_Tp, _Container>& __x,
353
361
template <class _Tp , three_way_comparable _Container>
354
362
_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t <_Container>
355
363
operator <=>(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) {
356
- // clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
357
- return __x.__get_container () <=> __y.__get_container ();
364
+ return __x.c <=> __y.c ;
358
365
}
359
366
360
367
# endif
0 commit comments