20 General utilities library [utilities]

20.20 Formatting [format]

20.20.2 Format string [format.string]

20.20.2.2 Standard format specifiers [format.string.std]

Table 62: Meaning of type options for integer types [tab:format.type.int]
Type
Meaning
b
to_­chars(first, last, value, 2); the base prefix is 0b.
B
The same as b, except that the base prefix is 0B.
c
Copies the character static_­cast<charT>(value) to the output.
Throws format_­error if value is not in the range of representable values for charT.
d
to_­chars(first, last, value).
o
to_­chars(first, last, value, 8); the base prefix is 0 if value is nonzero and is empty otherwise.
x
to_­chars(first, last, value, 16); the base prefix is 0x.
X
The same as x, except that it uses uppercase letters for digits above 9 and the base prefix is 0X.
none
The same as d.
[Note 8:
If the formatting argument type is charT or bool, the default is instead c or s, respectively.
— end note]