Reputation: 1709
Is it legal to unset all the formatting flags using unsetf
in C++?
Or is it at least legal to unset all the basefield
or floatfield
flags?
What's the defined behavior of e.g. std::cout
for that?
Upvotes: 2
Views: 252
Reputation: 60999
The behaviour is indeed defined. I looked this up when writing an insertion operator for big integers. Tables providing format specifiers for specific flags like table 75 (which concerns basefield
) or table 76 (floatfield
) have a default in any case. See also cppreference/num_put.
Upvotes: 2