C++ IOS Library - swap



Description

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.

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

Declaration

Following is the declaration for ios::swap function.

void swap (ios& x) noexcept;

Parameters

x − Another stream object of the same type.

Return Value

none

Exceptions

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

Data races

Modifies both stream objects (*this and x).

ios.htm
Advertisements