On May 13, 2022, at 11:18 AM, Peter Dimov via Boost
Marshall Clow wrote:
On May 13, 2022, at 10:42 AM, David Bien via Boost
wrote: I guess when I read the impl I think to myself: What this is missing is a
_length member. But then it just becomes boost::string_view.
What value added is there to this impl except that it is smaller than
boost::string_view due to lacking a _length member?
If you’re careful and don’t do much with it, it can hand you back a null terminated string.
???
In what scenarios will it not give you a null-terminated string?
char arr[6] = “hello"; cstring_view csv(arr); assert(strlen(csv.data())) == 5); arr[5] = ‘!’; assert(strlen(csv.data())) == 5); // boom — Marshall PS. It promises to give you a null-terminated string, but has no way to actually guarantee that.