...

/

Ordering before C++20

Ordering before C++20

Compare the method of ordering before and after C++ 20.

We'll cover the following...

The three-way comparison operator <=> is often called the spaceship operator. The spaceship operator determines for two values A and B, whether A < B, A == B, or A > B. You can define the spaceship operator, or the compiler can auto-generate it for you.

To appreciate the advantages of the three-way comparison operator, let me start with the classical way of doing it. ...