Namespaces
Variants

std::basic_istream<CharT,Traits>:: operator=

From cppreference.net
protected :
basic_istream & operator = ( const basic_istream & rhs ) = delete ;
(1)
protected :
basic_istream & operator = ( basic_istream && rhs ) ;
(2) (C++11부터)
1) 복사 할당 연산자는 protected로 선언되었으며 삭제되었습니다. 입력 스트림은 CopyAssignable이 아닙니다.
2) 이동 대입 연산자는 gcount() 값과 기본 클래스의 모든 데이터 멤버를 rdbuf() 를 제외하고 rhs 와 교환합니다. 마치 swap ( * rhs ) 를 호출하는 것처럼 동작합니다. 이 이동 대입 연산자는 protected로 선언되어 있습니다: 파생된 이동 가능 입력 스트림 클래스인 std::basic_ifstream std::basic_istringstream 의 이동 대입 연산자에 의해서만 호출되며, 이들은 관련된 스트림 버퍼를 올바르게 이동 대입하는 방법을 알고 있습니다.

매개변수

rhs - * this 에 할당할 basic_istream 객체

예제

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