This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
boolalpha
is setSection: 28.3.4.3.3.3 [facet.num.put.virtuals] Status: New Submitter: Hubert Tong Opened: 2016-05-07 Last modified: 2018-02-11
Priority: 3
View other active issues in [facet.num.put.virtuals].
View all other issues in [facet.num.put.virtuals].
View all issues with New status.
Discussion:
N4582 subclause 28.3.4.3.3.3 [facet.num.put.virtuals] paragraph 6 makes no provision for fill-padding in its
specification of the behaviour when (str.flags() & ios_base::boolalpha) != 0
.
[2017-07-06, Marshall comments]
All the other cases from num_put
— int
, long
, etc all are covered in
28.3.4.3.3.3 [facet.num.put.virtuals] p1 .. p5, which describe how to align and pad the output. (Specifically,
stage 3) p6 does not.
cout << std::setw(15) << false;
outputs:
0 ﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎// Column counter
but
cout << std::setw(15) << boolalpha << false;
outputs:
false
libc++ implements this exactly.
Dinkumware, libstdc++ and MSVC apply padding and alignment.
Proposed resolution: