mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
libstdc++: Use _M_reverse to reverse partial_ordering using operator<=>
The patch r16-3414-gfcb3009a32dc33 changed the representation of unordered to optimize reversing of order, but it did not update implementation of reversing operator<=>(0, partial_order). libstdc++-v3/ChangeLog: * libsupc++/compare (operator<=>(__cmp_cat::__unspec, partial_ordering)): Implement using _M_reverse. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
This commit is contained in:
@@ -155,12 +155,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
|
||||
[[nodiscard]]
|
||||
friend constexpr partial_ordering
|
||||
operator<=>(__cmp_cat::__unspec, partial_ordering __v) noexcept
|
||||
{
|
||||
if (__v._M_value & 1)
|
||||
return partial_ordering(__cmp_cat::_Ord(-__v._M_value));
|
||||
else
|
||||
return __v;
|
||||
}
|
||||
{ return partial_ordering(__cmp_cat::_Ncmp(__v._M_reverse())); }
|
||||
};
|
||||
|
||||
// valid values' definitions
|
||||
|
||||
Reference in New Issue
Block a user