[Bug libstdc++/113159] More robust std::sort for silly comparator functions
xry111 at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 22 05:34:29 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113159
--- Comment #12 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Also note even
bool cmp(Element a, Element b) { return false; }
is a *valid* comparator, per the standard. Though it'll likely produce
completely meaningless result, it's just your own logical error as it violates
nothing in the standard.
More information about the Gcc-bugs
mailing list