Skip to content

Glossary: Data Structures and Algorithms in C++

Spaceship operator (operator<=>)

Also written: operator<=>, spaceship operator, = default

A C++20 operator that, when written `= default`, makes the compiler generate all comparisons by comparing members in the order written. It lets a heap order a Delivery by deadline, then café name.

Where the book teaches it

Related terms

Priority queueHeap