# std::basic_iostream<CharT,Traits>::operator=

> C++ Atlas: `cppatlas.com/w/cpp/io/basic_iostream/operator=` | Source: https://en.cppreference.com/w/cpp/io/basic_iostream/operator= | Domain: Input/output | Standards: C++11

Assigns another stream object.

## Official Specification Summary (cppreference)

```cpp
basic_iostream& operator=( const basic_iostream& other ) = delete; // (1)

protected:
basic_iostream& operator=( basic_iostream&& other ); // (2) (since C++11)
```

Assigns another stream object.

1) Copy assignment is not allowed.

2) Move assigns another stream object. Effectively calls `swap(rhs)`. This move assignment operator is protected: it is called by the move assignment operators of the derived stream classes `std::basic_stringstream` and `std::basic_fstream` which know how to properly move-assign the associated stream buffers.

### Parameters

- `other` - another stream to assign state of

### Return value

`*this`

### See also

- [(constructor)](https://en.cppreference.com/w/cpp/io/basic_iostream/basic_iostream): constructs the object (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/io/basic_iostream/operator= (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.