Could anybody explain me what is the difference between overload ==
and <
?
For example, if I use a map:
map
The operator <
is needed, because the find operation bases on the inner implementation of map (on the tree). To be able to find in complexity better than linear, it can't have to compare with every element.
A good example of the similar algorithm is Binary Search. As you can see in sample pseudocode, it doesn't use the identity operator at all.