Only the debug version catches it at runtime and not the release version.
Not even at compile time
That is not usable enough for a standard library class.
-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Di 03.02.2026 00:34
Betreff: Re: [std-proposals] [Idea] Null-terminated string view (c_str_view / c_wstr_view) – a simpler alternative/complement to zstring_view
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
On Mon, Feb 2, 2026 at 10:30 AM Sebastian Wittmeier via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
>
> No, just call a function (from a single thread) breaks it:
>
>
>
> f(ts.substr(4, 7), ts.substr(6, 2));
The debug version catches that error:
https://godbolt.org/z/7MWb71v13