std::basic_iostream<CharT,Traits>::basic_iostream
来自cppreference.com
< cpp | io | basic iostream
输入/输出库
std::basic_iostream
成员函数 | ||||
basic_iostream::basic_iostream
|
||||
受保护成员函数 | ||||
explicit
basic_iostream( std::basic_streambuf<CharT,Traits>* sb
);
|
(1) | |
basic_iostream(
const
basic_iostream&
other )
=
delete;
|
(2) | (C++11 起) |
protected:
basic_iostream( basic_iostream&& other ); |
(3) | (C++11 起) |
构造新的流对象。
1) 以 streambuf
sb
初始化。基类初始化为 basic_istream<CharT,Traits>(sb) 和 basic_ostream<CharT,Traits>(sb) 。调用后 rdbuf()
== sb 而 gcount()
== 0 。2) 不允许复制构造。
3) 移动构造函数:移动构造第一基类
basic_istream
为 basic_istream<CharT,Traits>(std::move(rhs));
,这会继续移动构造并初始化虚基类 std::basic_ios 。另一基类
basic_ostream
的初始化是实现定义的(例如,可以添加不做任何事的受保护默认构造函数到 std::basic_ostream
),因为移动构造不能使用 rhs
二次。此移动构造函数受保护:它为导出流类 std::basic_fstream
和 std::basic_stringstream
的移动构造函数在它们移动并关联流缓冲前调用。参数
sb | - | 用以初始化的 streambuf |
other | - | 用以初始化的另一流 |
参阅
(C++11)
|
移动赋值另一 basic_iostream (受保护成员函数) |