function
<iomanip>

std::resetiosflags

/*unspecified*/ resetiosflags (ios_base::fmtflags mask);
Reset format flags
Unsets the format flags specified by parameter mask.

Behaves as if member unsetf were called with mask as argument on the stream on which it is inserted/extracted as a manipulator (it can be inserted/extracted on input streams or output streams).

See ios_base::fmtflags for more information on the particular flags that can be modified with this manipulator function.

This manipulator is declared in header <iomanip>.

Parameters

mask
Mask representing the flags to be reset.
fmtflags is a bitmask type.

Return Value

Unspecified. This function should only be used as a stream manipulator (see example).

Example

1
2
3
4
5
6
7
8
9
10
// resetiosflags example
#include <iostream>     // std::cout, std::hex, std::endl
#include <iomanip>      // std::setiosflags, std::resetiosflags

int main () {
  std::cout << std::hex << std::setiosflags (std::ios::showbase);
  std::cout << 100 << std::endl;
  std::cout << std::resetiosflags(std::ios::showbase) << 100 << std::endl;
  return 0;
}


This code first sets the showbase flag and then resets it using the resetiosflags manipulator. Output:

0x64
64

Data races

The stream object on which it is inserted/extracted is modified.
Concurrent access to the same stream object may introduce data races.

Exception safety

Basic guarantee: if an exception is thrown, the stream is in a valid state.

See also