std::basic_iostream::basic_iostream
来自cppreference.com
< cpp | io | basic iostream
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
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() == sbgcount() == 0.原文:
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)
拷贝构造函数是不允许的.....
3)
移动构造函数:移动建设的第一个基类
basic_istream
为basic_istream<CharT,Traits>(std::move(rhs));,这反过来又移动构建和初始化虚基std::basic_ios。初始化其他的基础,basic_ostream
,是实现定义的(例如,一个受保护的默认构造函数可以被添加到std::basic_ostream,它什么也不做),因为不能使用移动建设rhs
两次。这一举措的构造函数是受保护的,它被称为的举动所派生的流类的构造函数std::basic_fstreamstd::basic_stringstream之前,移动建构和流缓冲区相关联.原文:
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.[编辑] 参数
sb | - | 的streambuf来初始化
|
other | - | 另一个数据流进行初始化
|
[编辑] 另请参阅
(C++11) |
移动给其他 basic_iostream 原文: move-assigns another basic_iostream (公共成员函数) |