What is the (“spaceship”, three-way comparison) operator in C++?

This is called the three-way comparison operator. According to the P0515 paper proposal: There’s a new three-way comparison operator, <=>. The expression a <=> b returns an object that compares <0 if a < b, compares >0 if a > b, and compares ==0 if a and b are equal/equivalent. To write all comparisons for … Read more