std::basic_string_view<CharT, Traits> view() const noexcept;
Creates and returns a
std::basic_string_view over the underlying character sequence.
pbase()to the last character in the sequence regardless of
The member character sequence in a buffer open for writing can be over-allocated for efficiency purposes. In that case, only the initialized characters are referenced: these characters are the ones that were obtained from the string argument of the constructor, the string argument used by the most recent call to a setter overload of
str(), or from a write operation. A typical implementation that uses over-allocation maintains a high-watermark pointer to track the end of the initialized part of the buffer and the returned view references the characters from
pbase() to the high-watermark pointer.
A view over the underlying character sequence.
Using of the return value is undefined behavior if the underlying character sequence is destroyed or invalidated, unless the return value is empty.
This function is typically accessed through
| replaces or obtains a copy of the associated character string
(public member function)
| returns a non-modifiable string_view into the entire string
(public member function of
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.