std::basic_...sic_iostream(3)

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

hey bestie, welcome to the std::basic_...sic_iostream(3) page from the C++ Standard Libary πŸ’– this is the constructor page, and it’s lowkey iconic.

🌸 NAME 🌸

std::basic_iostream::basic_iostream β€” std::basic_iostream::basic_iostream 🫢


✨ Synopsis ✨

explicit basic_iostream( std::basic_streambuf<CharT,Traits>* sb );
(1)
basic_iostream( const basic_iostream& other ) = delete;
(2) (since C++11)
protected:
(3) (since C++11)
basic_iostream( basic_iostream&& other );

Constructs new stream object. πŸ’…

  1. Initializes with streambuf sb. The base classes are initialized as basic_istream<CharT,Traits>(sb) and basic_ostream<CharT,Traits>(sb). After the call rdbuf() == sb and gcount() == 0. ✨
  2. Copy construction is not allowed. 🚫
  3. Move constructor: move-constructs the first base class basic_istream as basic_istream<CharT,Traits>(std::move(rhs));, which in turn move-constructs and initializes the virtual base std::basic_ios. The initialization of the other base, basic_ostream, is implementation-defined (e.g., a protected default constructor may be added to std::basic_ostream, which does nothing) because move-construction cannot use rhs twice. This move constructor is protected: it is called by the move constructors of the derived stream classes std::basic_fstream and std::basic_stringstream before they move-construct and associate the stream buffer. πŸ”₯

πŸŽ€ Parameters πŸŽ€

  • sb β€” streambuf to initialize with πŸ’–
  • other β€” another stream to initialize with 🫢

πŸ¦‹ See also πŸ¦‹

  • operator= β€” move-assigns another basic_iostream (C++11) (protected member function) ⭐

okay bye bestie, source is http://cppreference.com, version/date is 2024.06.10, and the page is std::basic_...sic_iostream(3) β€” mwah πŸ’‹

πŸ“¦ where this page comes from