Std :: set <K, C> :: operator <(const std :: set <K, C> &) does not use C (), but std :: less ()
Actually, this is not an error in implementation, although it is probably one in the standard:
23.2.1 General requirements for containers [container.requirements.general] 13 Table 98 lists the operations that are provided for some types of containers, but not for others. Those containers for which the listed operations are intended should implement the semantics described in table 98, unless otherwise indicated.
The table contains:
a < b
convert toboollexicographical_compare(a.begin(),a.end(),b.begin(),b.end())
pre: <is defined for T. <is the full ordering relation.
linear
While the following sections indicate that std::set provides comparison operators, unfortunately this does not change the definition from the above.
As an aside, std::lexicographical_compare does not actually use std::less , but directly uses < . Not that it was any meaningful.