std::basic_..._ispanstream(3)

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

πŸŽ€ NAME πŸŽ€

okay so this is from the std::basic_..._ispanstream(3) page in the C++ Standard Libary, and the name is literally:

std::basic_ispanstream::basic_ispanstream - std::basic_ispanstream::basic_ispanstream

Yes bestie, the constructor name is the same as the class. Iconic behavior, no notes. πŸ’…


✨ Synopsis ✨

Copying the synopsis exactly, because we do not mess with signatures:

explicit basic_ispanstream( std::span<CharT> s,
std::ios_base::openmode mode =
(1) (since C++23)
                                       std::ios_base::in );
template< class ROS >
(2) (since C++23)
explicit basic_ispanstream( ROS&& r );
basic_ispanstream( basic_ispanstream&& rhs );
(3) (since C++23)
basic_ispanstream( const basic_ispanstream& ) = delete;
(4) (since C++23)

πŸ¦‹ Description πŸ¦‹

Constructs a new basic_ispanstream. Main character constructor energy fr fr.

  1. Uses the storage referenced by s as 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::in).
  2. Uses the storage referenced by r after converted to std::span<const CharT> as initial underlying buffer of the wrapped std::basic_spanbuf device. The wrapped std::basic_spanbuf object is opened in mode std::ios_base::in. This overload participates in overload resolution only if ROS models borrowed_range, std::convertible_to<ROS, std::span<CharT>> is false, and std::convertible_to<ROS, std::span<const CharT>> is true.
  3. Move constructor. Move constructs the std::basic_istream 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.
  4. Copy constructor is deleted. basic_ispanstream is not copyable.
Not copyable, bestie. The copy constructor said β€œabsolutely not” and deleted herself from the group chat. 😭

πŸ’– Parameters πŸ’–

  • s β€” std::span referencing the storage to be use as initial underlying buffer of stream
  • r β€” borrowed_range 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_ispanstream to be moved from

πŸ’€ Exceptions πŸ’€

May throw implementation-defined exceptions.

So like… stay alert, queen. Implementation-defined means the implementation gets to choose the drama. πŸ™ˆ


🌸 Example 🌸

This section is incomplete.

Reason: no example.

Not me staring at the empty example section like it’s gonna manifest one by sheer will. 🫢


πŸ‘‘ See also πŸ‘‘

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

🧚 Category 🧚

  • Todo no example

okay bye bestie πŸ’… this was from source/version http://cppreference.com, dated 2024.06.10, and it’s the std::basic_..._ispanstream(3) page. Slay, hydrate, and don’t delete your copy constructor unless you mean it. πŸŽ€βœ¨

πŸ“¦ where this page comes from