public member function
<streambuf> <iostream>


void swap (streambuf& rhs);
Swap stream buffers
Exchanges the contents of rhs and *this. This includes the internal pointers and the locale object.

This is a protected member provided for convenience in derived classes.


Another streambuf object.

Return value


Data races

Modifies both the stream buffer object and rhs.
Concurrent access to either objects may introduce data races.

Exception safety

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

See also