public member function
<streambuf> <iostream>


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

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


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

Return value


Data races

Modifies both the stream buffer object and x.
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