Reputation: 76529
All the basic comparisons (<
, <=
, ==
, !=
, >=
, >
) have an associated function object (std::less
, std::less_equal
, std::equal_to
, std::not_equal_to
, std::greater_equal
, std::greater
).
Does the spaceship operator <=>
have a similar function object?
If not, why was it not added to the standard library?
Upvotes: 22
Views: 1227
Reputation: 22219
std::compare_three_way
is the function object for three-way comparison (aka. spaceship operator).
Upvotes: 24