The Comparison Criterion
This lesson talks about the rules followed by ordered associative containers when comparing the values inside them.
The default comparison criterion of the ordered associative containers is std::less
. If we want to use a user-defined type as the key, we have to overload the operator <
. It’s sufficient to overload the operator <
for our data type because the C++ runtime compares, with the help of the relation ...