std::basic_..._ospanstream(3)

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

πŸ’– NAME πŸ’–

okay so this is the manual page for std::basic_ospanstream::basic_ospanstream, aka the std::basic_..._ospanstream(3) page from the C++ Standard Library. It’s all about constructing a new basic_ospanstream, and yes bestie it’s giving C++23 icon energy ✨.


✨ Synopsis ✨

          explicit basic_ospanstream( std::span<CharT> s,
          std::ios_base::openmode mode =
       (1) (since C++23)
                                          std::ios_base::out );
          basic_ospanstream( basic_ospanstream&& rhs );
       (2) (since C++23)
          basic_ospanstream( const basic_ospanstream& ) = delete;
       (3) (since C++23)

Constructs a new basic_ospanstream. Periodt πŸ’….

  1. (1) (since C++23) β€” 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 | std::ios_base::out).
  2. (2) (since C++23) β€” Move constructor. Move constructs the std::basic_ostream 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. (3) (since C++23) β€” Copy constructor is deleted. basic_ospanstream is not copyable.

πŸŽ€ Parameters πŸŽ€

  • s β€” a std::span referencing the storage to be used as the initial underlying buffer of the stream.
  • mode β€” specifies stream open mode. The 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_ospanstream to be moved from

🌈 Exceptions 🌈

May throw implementation-defined exceptions. No cap, that’s literally what it says 😭.


πŸ¦‹ Example πŸ¦‹

This section is incomplete Reason: no example

🌸 See also 🌸

  • constructor β€” constructs a basic_spanbuf object (C++23) (public member function of std::basic_spanbuf<CharT,Traits>)

πŸ‘‘ Category πŸ‘‘

  • Todo no example

later, bestie 🫢 β€” this came from http://cppreference.com, version/date 2024.06.10, and the manual tag is std::basic_..._ospanstream(3).

πŸ“¦ where this page comes from