hackingcpp / comments

Comments regarding hackingcpp.com
1 stars 0 forks source link

cpp/lang/comparisons #51

Open utterances-bot opened 10 months ago

utterances-bot commented 10 months ago

C++ Custom Type Comparisons | hacking C++

The philosophy behind and how to implement comparison operations in C++ including C++20's

https://hackingcpp.com/cpp/lang/comparisons.html

JohannJo commented 10 months ago

When you write "a < b implies f(a) < f(b), etc." what function f do you take? Because it wouldn't work for a function like f(x)=-x for example.