std::basic_...c_spanstream(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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:

  1. Uses the storage referenced by s as the initial underlying buffer of the wrapped std::basic_spanbuf device. The wrapped std::basic_spanbuf object is constructed as basic_spanbuf<Char, Traits>(s, mode).
  2. Move constructor. Move constructs the std::basic_iostream base subobject and the wrapped std::basic_spanbuf from those of rhs, and then calls set_rdbuf with the address of the wrapped std::basic_spanbuf in *this to install it.
  3. Copy constructor is deleted. basic_spanstream is not copyable. Not me trying to copy it and getting absolutely cooked 😭

🌈 Parameters 🌈

  • s β€” a std::span referencing the storage to be use as initial underlying buffer of stream
  • mode β€” specifies stream open mode. Following constants and bit-wise OR between them may be used:
    • app β€” seek to the end of stream before each write
    • binary β€” open in binary mode
    • in β€” open for reading
    • out β€” open for writing
    • trunc β€” discard the contents of the stream when opening
    • ate β€” seek to the end of stream immediately after open
    • noreplace (C++23) β€” open in exclusive mode
  • other β€” another basic_spanstream to 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_spanbuf object (C++23) (public member function of std::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