Title
No provision for fill-padding when boolalpha is set
Status
new
Section
[facet.num.put.virtuals]
Submitter
Hubert Tong

Created on 2016-05-07.00:00:00 last changed 82 months ago

Messages

Date: 2017-07-15.00:00:00

[ 2017-07-06, Marshall comments ]

All the other cases from num_putint, long, etc all are covered in [facet.num.put.virtuals] p1 .. p5, which describe how to align and pad the output. (Specifically, stage 3) p6 does not.

With this description:

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.

I think that applying padding and alignment is more appropriate.

Date: 2016-05-07.00:00:00

N4582 subclause [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.

History
Date User Action Args
2017-07-06 18:10:22adminsetmessages: + msg9320
2016-05-07 00:00:00admincreate