The valid values of std::strong_ordering
are less
, equal
, equivalent
, and greater
. However, it appears that strong_ordering::equivalent
and strong_ordering::equal
are equal (i.e., interchangeable), since in both cases the exposition-only value
field equals zero, and there is no other state for the exposition-only constructor to initialize.
It makes sense that strong_ordering
doesn't have any separate equivalent
value, since equivalent values are always equal when the ordering is strong. But what's the point of making strong_ordering::equivalent
a synonym for strong_ordering::equal
, as opposed to not defining it at all?
This allows
C::equivalent
to be defined for all comparison categoriesC
. There used to be five of them, all of which had this, now just the three.If you need something like that, it helps to have it. And it costs nothing to provide, so... there it is.