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.

2703. No provision for fill-padding when boolalpha is set

Section: [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.


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.

[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;


﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎﹎// Column counter


cout << std::setw(15) << boolalpha << false;



libc++ implements this exactly.
Dinkumware, libstdc++ and MSVC apply padding and alignment.

I think that applying padding and alignment is more appropriate.

Proposed resolution: