public member function
<streambuf> <iostream>

std::basic_streambuf::swap

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.

Parameters

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

Return value

none

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