I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Public member functions | ||||
(C++11) | ||||
(C++11) | ||||
basic_stringbuf::view (C++20) | ||||
Protected member functions | ||||
Non-member functions | ||||
(C++11) | ||||
Exposition-only member functions | ||||
std::basic_string_view<CharT, Traits> view()constnoexcept; | (since C++20) | |
Creates and returns astd::basic_string_view over the underlying character sequence.
The member character sequence in a buffer open for writing can be over-allocated for efficiency purposes. In that case, only theinitialized 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 ofstr()
, 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 frompbase() to the high-watermark pointer.
Contents |
(none)
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 throughstd::basic_istringstream::view(),std::basic_ostringstream::view(), orstd::basic_stringstream::view().
replaces or obtains a copy of the associated character string (public member function)[edit] | |
(C++17) | returns a non-modifiablebasic_string_view into the entire string(public member function of std::basic_string<CharT,Traits,Allocator> )[edit] |