
Spaceship Operator operator<=> 4/4
The spaceship operator returns one of following ordering (classes) <compare> :
std::strong_ordering • If a is equivalent to b , f(a) is also equivalent to f(b)
• Exactly one of < , == , or > must be true
◦ e.g., integral types ( int , char )
std::weak_ordering • If a is equivalent to b , f(a) may not be equivalent to f(b)
• Exactly one of < , == , or > must be true
◦ e.g., rectangles R{2, 5} == R{5, 2}
std::partial_ordering • If a is equivalent to b , f(a) may not be equivalent to f(b)
• < , == , or > may all be false
◦ e.g., floating-point ( float with NaN )
41/66