public member function


void swap (basic_filebuf& x);
Swap file buffers
Exchanges the contents and state of x and *this. This includes the internal pointers and the locale object.


Another basic_filebuf object of the same type (i.e., instantiated with the same template parameters, charT and traits).

Return value


Data races

Modifies both basic_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