[Bug libstdc++/60519] Debug mode should check comparators for irreflexivity

fdumont at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Apr 12 19:57:00 GMT 2015


--- Comment #2 from François Dumont <fdumont at gcc dot gnu.org> ---
Created attachment 35305
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35305&action=edit
Strict weak ordering debug check patch

On my side here what I had plan to do. This patch rely on additional feature in
the _Formatter type to pass a type or iterator value_type to point the user to
the invalid operator or functor. It also do not perform the check if the
comparator is not able to handle it.

So yes it doubles the number of comparisons which is definitely a performance
hint but your patch on the other hand expect to detect an implementation issue
on only 1 use case so it can miss many kind of wrong implementation on special

More information about the Gcc-bugs mailing list