by johannes1234321 · 6y ago · 0 comments
With operator<=> one can implement a single function and the compiler becomes the smart one. When calling o1 < o2 or calling o1 >= o2 the compiler will do a call to the single operator<=> and interpret the return value accordingly.
Notably less repitive typing for the type provider.
I found a blog post which raised similar concerns [0], and P1185 [1] proposes some solutions. I don't know whether they made it into the standard, though.
[0]: https://foonathan.net/2018/10/spaceship-proposals/
[1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p118...