public member function
<streambuf> <iostream>

std::streambuf::swap

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.

Parameters

rhs
Another streambuf object.

Return value

none

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