https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113159

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Yury Gribov from comment #10)
> As a compiler user I would actually love my STL to crash fast on invalid
> comparators rather than produce unpredictable and meaningless results which
> will cause my program to misbehave later on in ways which are much harder to
> debug.

That's what _GLIBCXX_DEBUG and/or _GLIBCXX_ASSERTIONS are for.

Ideally we will not have any unbounded undefined behaviour (including crashes)
by default, even if the user screwed up the input range or the comparator, but
with debug assertions enabled the invalid inputs will cause termination.

Reply via email to