Simplify Your Code With Rocket Science: C++20’s Spaceship Operator
C++20 adds a new operator, affectionately dubbed the “spaceship” operator:
<=>. There was a post awhile back by our very own Simon Brand detailing some information regarding this new operator along with some conceptual information about what it is and does. The goal of this post is to explore some concrete applications of this strange new operator and its associated counterpart, the
operator== (yes it has been changed, for the better!), all while providing some guidelines for its use in everyday code.