public member function
<fstream>

std::basic_filebuf::operator=

basic_filebuf& operator= (const basic_filebuf& rhs);
Move-assignment
Closes the file buffer (as if member close was called), and then acquires the contents of rhs.

rhs is a closed buffer after the call with an otherwise unspecified but valid state.
It is unspecified whether the internal sequence is the one in rhs before the call, or a copy of it. In any case, both objects use independent sequences after the call (if any).

Parameters

rhs
A basic_filebuf object of the same type (with the same class template parameters charT and traits), whose internals are moved.

Return Value

*this

Data races

Modifies both basic_filebuf objects (*this and rhs).
Concurrent access to the same file stream buffer objects may introduce data races.

Exception safety

Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.

See also