To wait until the real thing.
How to Emulate the Spaceship Operator Before C++20 with CRTP
by Henrik Sjöström
From the article:
Making a class comparable is usually something of a chore. In C++20 we’ll get the “three-way comparison operator” or informally spaceship operator <=>. It will allow the compiler to create comparison operators when we want a simple lexicographical comparison and when we have a more complex comparison we only need to implement a single operator to be able to do all comparisons...
Add a Comment
Comments are closed.