27 Input/output library [input.output]

27.5 Iostreams base classes [iostreams.base]

27.5.3 Class ios_base [ios.base]

27.5.3.1 Types [ios.types]

27.5.3.1.2 Type ios_base::fmtflags [ios::fmtflags]

typedef T1 fmtflags;

The type fmtflags is a bitmask type ([bitmask.types]). Setting its elements has the effects indicated in Table [tab:iostreams.fmtflags.effects].

Table 122fmtflags effects
ElementEffect(s) if set
boolalpha insert and extract bool type in alphabetic format
dec converts integer input or generates integer output in decimal base
fixed generate floating-point output in fixed-point notation
hex converts integer input or generates integer output in hexadecimal base
internal adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated
left adds fill characters on the right (final positions) of certain generated output
oct converts integer input or generates integer output in octal base
right adds fill characters on the left (initial positions) of certain generated output
scientific generates floating-point output in scientific notation
showbase generates a prefix indicating the numeric base of generated integer output
showpoint generates a decimal-point character unconditionally in generated floating-point output
showpos generates a + sign in non-negative generated numeric output
skipws skips leading whitespace before certain input operations
unitbuf flushes output after each output operation
uppercase replaces certain lowercase letters with their uppercase equivalents in generated output

Type fmtflags also defines the constants indicated in Table [tab:iostreams.fmtflags.constants].

Table 123fmtflags constants
ConstantAllowable values
adjustfield left | right | internal
basefield dec | oct | hex
floatfield scientific | fixed