|
Boost : |
From: Seth (bugs_at_[hidden])
Date: 2022-05-13 12:34:43
> I donât see how this is supposed to maintain the invariant ( null
> temination) w/o itâs own storage.
I had similar concerns, but then I looked at the code, and ... you know, it answers the question.
>
> Consider:
> cstring_view sv; // is sv-data() pointing to a null-terminated
> string? If so, where did it come from?
The appriopriate static character literal.
> cstring_view sv1(âabcdefgâ)â
> sv1.substring(3, 2); // whatâs the value of strlen(sv.data) here?
> How can it be 2?
Length-constrained substring returns string_view.
Seth
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk