Implementing the spaceship operator for optional—Barry Revzin

Save to:
Instapaper Pocket Readability

The future implementation?

Implementing the spaceship operator for optional

by Barry Revzin

From the article:

Last week, the C++ Standards Committee added operator<=>, known as the spaceship operator, to the working draft for what will eventually become C++20. This is an exciting new language feature for two reasons: it allows you to write one function to do all your comparisons where you used to have to write six, and it also allows you to write zero functions — just declare the operator as defaulted and the compiler will do all the work for you! Exciting times...

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.