public member function
<ios> <iostream>
void unsetf (fmtflags mask);
Clear specific format flags
Clears the format flags selected in mask.
The parameterized manipulator resetiosflags behaves in a similar way as this member function.
Parameters
- mask
- Bitmask specifying the flags to be cleared. The flags are specified as a combination of flags of the fmtflags member type.
Example
1 2 3 4 5 6 7 8 9 10 11
|
// modifying flags with setf/unsetf
#include <iostream> // std::cout, std::ios
int main () {
std::cout.setf ( std::ios::hex, std::ios::basefield ); // set hex as the basefield
std::cout.setf ( std::ios::showbase ); // activate showbase
std::cout << 100 << '\n';
std::cout.unsetf ( std::ios::showbase ); // deactivate showbase
std::cout << 100 << '\n';
return 0;
}
| |
Output:
Data races
Modifies the stream object.
Concurrent access to the same stream object may cause data races.
Exception safety
Basic guarantee: if an exception is thrown, the stream is in a valid state.