std::basic_spanbuf::span(3)
π std::basic_spanbuf::span π
okay bestie, welcome to the std::basic_spanbuf::span(3) page from the C++ Standard Libary manual β yes, the manual name is folded right in here like a cute little intro, and this whole page is about std::basic_spanbuf::span. slay. π
πΈ NAME πΈ
std::basic_spanbuf::span β literally std::basic_spanbuf::span, no cap.
β¨ Synopsis β¨
std::span<CharT> span() const noexcept; (1) (since C++23)
void span( std::span<CharT> s ) noexcept; (2) (since C++23)
okay so overload (1) gets a span referencing the written area if std::ios_base::out is set in the open mode, or a span referencing the underlying buffer otherwise. overload (2) makes the basic_spanbuf perform I/O on the buffer referenced by s, and it sets pointers to the get area, the put area, or both. π«Ά
π get area pointer setup π
Set bits in open mode (affecting pointers to get area):
std::ios_base::inβ after setting:eback()returnss.data(),gptr()returnss.data(), andegptr()returnss.data() + s.size().
π put area pointer setup π
Set bits in open mode (affecting pointers to put area):
std::ios_base::out && !std::ios_base::ateβ after setting:pbase()returnss.data(),pptr()returnss.data(), andepptr()returnss.data() + s.size().std::ios_base::out && std::ios_base::ateβ after setting:pbase()returnss.data(),pptr()returnss.data() + s.size(), andepptr()returnss.data() + s.size().
π«Ά Parameters π«Ά
sβ astd::spanthat references the user-provided buffer.
π Return value π
std::span<CharT>(pbase(), pptr())ifstd::ios_base::outis set in the open mode, or astd::span<CharT>that references the whole underlying buffer otherwise.- (none)
π¦ Example π¦
This section is incomplete Reason: no example
π See also π
strβ replaces or obtains a copy of the associated character string (public member function ofstd::basic_stringbuf<CharT,Traits,Allocator>).viewβ obtains a view over the underlying character sequence (C++20) (public member function ofstd::basic_stringbuf<CharT,Traits,Allocator>).strβ marks the buffer frozen and returns the beginning pointer of the input sequence (public member function ofstd::strstreambuf).
π Category π
- Todo no example
xoxo bestie π β source/version: http://cppreference.com, date: 2024.06.10, and this iconic page is std::basic_spanbuf::span(3). πβ¨
π¦ 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