std::basic_spanbuf::setbuf(3)
std::basic_spanbuf::setbuf(3) π
okay so this is the C++ Standard Libary manual page for std::basic_spanbuf::setbuf β and yes bestie, the header spells it βLibary,β weβre keeping that exactly as-is, no editing the icon.
πΈ NAME
std::basic_spanbuf::setbuf β std::basic_spanbuf::setbuf. Thatβs the whole NAME section, no cap.
β¨ Synopsis β¨
protected:
std::basic_streambuf<CharT, Traits>* setbuf( CharT *s,
std::streamsize n ) override;
(since C++23) β bestie, this one is new new.
Makes the basic_spanbuf perform I/O on the buffer [s, s + n). Equivalently calls this->span(std::span<CharT>(s, n)) and then returns this.
Hereβs the pointer vibe check:
- Set bits in open mode (affecting pointers to get area):
std::ios_base::in- Return value after setting
eback():s - Return value after setting
gptr():s - Return value after setting
egptr():s + n
- Return value after setting
- Set bits in open mode (affecting pointers to put area):
std::ios_base::out && !std::ios_base::ate- Return value after setting
pbase():s - Return value after setting
pptr():s - Return value after setting
epptr():s + n
- Return value after setting
- Set bits in open mode (affecting pointers to put area):
std::ios_base::out && std::ios_base::ate- Return value after setting
pbase():s - Return value after setting
pptr():s + n - Return value after setting
epptr():s + n
- Return value after setting
This function is protected virtual, it may only be called through pubsetbuf() or from member functions of a user-defined class derived from std::basic_spanbuf.
π Parameters
sβ pointer to the firstCharTin the user-provided buffer.nβ the number ofCharTelements in the user-provided buffer.
π Return value
this β thatβs it, thatβs the return value, periodt.
π¦ Notes
The deprecated stream buffer std::strstreambuf or the boost.IOStreams device boost::basic_array can also implement I/O buffering over a user-provided char array.
π§ͺ Example
This section is incomplete β Reason: no example. Not me showing up with zero example π
π See also
pubsetbufinvokessetbuf()β public member function ofstd::basic_streambuf<CharT,Traits>.setbufattempts to replace the controlled character sequence with an array[virtual]β virtual protected member function ofstd::basic_stringbuf<CharT,Traits,Allocator>.setbufattempts to replace the controlled character sequence with an array[virtual]β virtual protected member function ofstd::strstreambuf.
π·οΈ Category
* Todo no example
source/version: cppreference.com; date: 2024.06.10 β mwah, go slay those buffers, bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms