protected member function
<ostream> <iostream>


void swap (basic_ostream& x);
Swap internals
Exchanges all internal members between x and *this, except the pointers to the associated stream buffers: rdbuf shall return the same in both objects as before the call.

Internally, the function calls basic_ios::swap.

Derived classes can call this function to implement custom swap functions.


Another basic_ostream object with the same template parameters (charT and traits).

Return Value


Data races

Modifies both stream objects (*this and x).

Exception safety

No-throw guarantee: this member function never throws exceptions.

See also