...
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, two sets x
and y
, whose I 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.
...