Namespaces
Variants
Views
Actions

Talk:cpp/language/operator comparison

From cppreference.com

It would be nice to have an example of the three-way comparison operator


The standard library overloads section is a little confusing, particularly with the "(removed in C++20)" indications. Where a class newly implements the spaceship operator, that's fair enough that all other operators are removed in C++20 -- except that in this case, is often not marked as removed, which seems odd. Conversely, many other classes that do not implement the spaceship operator (such as std::complex) do have marked as (removed in C++20), which also seems wrong -- unless the has , but that isn't indicated anywhere. Also, correct me if I'm wrong, but doesn't get defined automatically unless you either explicitly default the or define , correct? That's what default comparisons seems to imply. 124.157.79.144 15:17, 2 November 2020 (PST)