std::basic_...c_spanstream(3)
π NAME π
Okay bestie, welcome to the std::basic_...c_spanstream(3) page from the C++ Standard Libary manual β yes, that's the exact manual name, and we're keeping it π
β¨
std::basic_spanstream::basic_spanstreamβstd::basic_spanstream::basic_spanstream
This page is literally about that constructor, no cap π«Ά
β¨ Synopsis β¨
Here's the synopsis, copied exactly because we do not mess with code, periodt:
explicit basic_spanstream( std::span<CharT> s,
std::ios_base::openmode mode =
(1) (since C++23)
std::ios_base::in |
std::ios_base::out );
basic_spanstream( basic_spanstream&& rhs );
(2) (since C++23)
basic_spanstream( const basic_spanstream& ) = delete;
(3) (since C++23)
πΈ Description πΈ
Constructs a new basic_spanstream β that's the whole vibe, but here are the deets:
- Uses the storage referenced by
sas the initial underlying buffer of the wrappedstd::basic_spanbufdevice. The wrappedstd::basic_spanbufobject is constructed asbasic_spanbuf<Char, Traits>(s, mode). - Move constructor. Move constructs the
std::basic_iostreambase subobject and the wrappedstd::basic_spanbuffrom those ofrhs, and then callsset_rdbufwith the address of the wrappedstd::basic_spanbufin*thisto install it. - Copy constructor is deleted.
basic_spanstreamis not copyable. Not me trying to copy it and getting absolutely cooked π
π Parameters π
sβ astd::spanreferencing the storage to be use as initial underlying buffer of streammodeβ specifies stream open mode. Following constants and bit-wise OR between them may be used:appβ seek to the end of stream before each writebinaryβ open in binary modeinβ open for readingoutβ open for writingtruncβ discard the contents of the stream when openingateβ seek to the end of stream immediately after opennoreplace(C++23) β open in exclusive mode
otherβ anotherbasic_spanstreamto be moved from
π Exceptions π
May throw implementation-defined exceptions. That's it, that's the warning β implementation-defined, so it's giving "ask your implementation" energy π
πΈ Example πΈ
This section is incomplete
Reason: no example
Literally no example yet, bestie π
π See also π
- constructor β constructs a
basic_spanbufobject (C++23) (public member function ofstd::basic_spanbuf<CharT,Traits>)
π·οΈ Category π·οΈ
- Todo no example
Okay bestie, that's the whole page β cute little sign-off: source http://cppreference.com, version/date 2024.06.10, page std::basic_...c_spanstream(3). Slay πβ¨
π¦ 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