std::basic_iostream<CharT,Traits>::basic_iostream
From cppreference.com
< cpp | io | basic iostream
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Input/output library
Print functions (C++23)
Buffers
(C++23)
(C++98/26*)
(C++20)
Streams
Abstractions
File I/O
String I/O
Array I/O
(C++23)
(C++23)
(C++23)
(C++98/26*)
(C++98/26*)
(C++98/26*)
Synchronized Output
(C++20)
Types
Error category interface
(C++11)
(C++11)
std::basic_iostream
Member functions
basic_iostream::basic_iostream
Protected member functions
explicit basic_iostream( std::basic_streambuf <CharT,Traits>* sb );
(1)
basic_iostream( const basic_iostream& other ) = delete;
(2)
(since C++11)
protected:
basic_iostream( basic_iostream&& other );
(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.[edit] Parameters
sb
-
streambuf to initialize with
other
-
another stream to initialize with