std::setiosflags

Header: <iomanip>

When used in an expression out « setiosflags(mask) or in » setiosflags(mask), sets all format flags of the stream out or in as specified by the mask.

# Declarations

/*unspecified*/ setiosflags( std::ios_base::fmtflags mask );

# Parameters

# Return value

An object of unspecified type such that

# Example

#include <iomanip>
#include <iostream>
 
int main()
{
    std::cout << std::resetiosflags(std::ios_base::dec) 
              << std::setiosflags(  std::ios_base::hex
                                  | std::ios_base::uppercase
                                  | std::ios_base::showbase) << 42 << '\n';
}

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 183C++98setiosflags could only be used with streamsof type std::ostream or std::istreamusable with anycharacter stream

# See also