Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected transitivity requirement. (Counterexample to old formulation: x=1, y=3, z=2)

...

  • For all xx < x == false (irreflexivity)
  • For all x, y: if x < y then !(y < x) (asymmetry)
  • For all xyz:  if x < y && y < z == then x < z (transitivity)

Providing an invalid ordering predicate for an associative container, or as a comparison criterion with the sorting algorithms, can result in erratic behavior or infinite loops [Meyers 01]. When an ordering predicate is required for an associative container or a generic standard template library algorithm, the predicate must meet the requirements for inducing a strict weak ordering.

...