public member function
<fstream>
Swap file buffers
Exchanges the contents and state of x and *this
. This includes the internal pointers and the locale object.
Parameters
- x
- Another filebuf object of the same type (i.e., instantiated with the same template parameters, charT and traits).
Data races
Modifies both filebuf objects (*this
and x).
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
- swap
- Exchange values of two objects (function template
)
- filebuf::operator=
- Move-assignment (public member function
)
class templates:
classes: