
13 May
2022
13 May
'22
12:34 p.m.
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