Boost logo

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