3 ms·
- It has range semantics, so you can use it with standard algos or range for. - It encodes the invariant in a type (char * points to at least size bytes, no ex
by gpderetta 9y ago
- It has range semantics, so you can use it with standard algos or range for.
- It encodes the invariant in a type (char * points to at least size bytes, no expectation of null termination, no ambiguous definition of an empty range)
- The size always travel with the pointer so no chance that it gets separated.
- syntactically simple conversion from string (or other string-like entities) to string view reduces clutter in the code.
I consider lack of null termination a plus.