...
In this noncompliant code example, the objects stored in the std::set
have an overloaded operator<
implementation, allowing the objects to be compared with std::less
. However, the comparison operation does not provide a strict weak ordering. Specifically, the values 1, N
and 1, M
can two sets x and y, whose I values are both 1, but have differing j values can result in a situation where comp(x, y) == and comp(y, x)
are both false, failing the asymmetry requirements.
...