std::basic_istream::operator=

来自cppreference.com
< cpp‎ | io‎ | basic istream

protected:
basic_istream& operator=( const basic_istream& rhs ) = delete;
(1)
protected:
basic_istream& operator=( basic_istream&& rhs );
(2) (C++11 起)
1)
拷贝赋值运算符的保护,而且将被删除。输入流不CopyAssignable的.
原文:
The copy assignment operator is protected, and is deleted. Input streams are not CopyAssignable.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
2)
移动赋值运算符交流gcount的()值和基类的所有数据成员,除了rdbuf()rhs,如果通过调用swap(*rhs)。这一举动赋值运算符的保护:它只能被称为运营商的移动输入流类派生的举动所分配std::basic_ifstreamstd::basic_istringstream,哪知道如何正确地移动分配的相关streambuffers.
原文:
The move assignment operator exchanges the gcount() values and all data members of the base class, except for rdbuf(), with rhs, as if by calling swap(*rhs). This move assignment operator is protected: it is only called by the move assignment operators of the derived movable input stream classes std::basic_ifstream and std::basic_istringstream, which know how to correctly move-assign the associated streambuffers.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 参数

rhs -
将basic_istream对象从中分配给*this
原文:
the basic_istream object from which to assign to *this
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 示例

#include <sstream>
#include <iostream>
int main()
{
    std::istringstream s1;
    s1 = std::istringstream("test"); // OK
 
    std::cin = std::istringstream("test"); // ERROR: 'operator=' is protected
}