C++20 three-way comparison operator: Part 3--Gajendra Gulgulia

Save to:
Instapaper Pocket Readability

The series continue.

C++20 three-way comparison operator: Part 3

by Gajendra Gulgulia

From the article:

In the second part of the tutorial series, I touched upon the rules of the default operator<=> . Unlike default constructors or destructors, the default version of the <=> is not available automatically but has to be declared in the interface of the class and then only it is available to be used.
In this part of the tutorial series, I’ll explain the mechanics of the default operator<=> to further elucidate the rules of the three-way operator, i.e. what exactly is the compiler doing when it sees an expression a < b on a custom object for which no comparison operator is overloaded but only a default version of the operator<=> is declared...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.