-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
The current implementation of vprint_[non]unicode pads the output based on the stream's width setting:
llvm-project/libcxx/include/__ostream/print.h
Lines 59 to 66 in a33ae1b
| if (std::__pad_and_output( | |
| _Ip(__os), | |
| __str, | |
| (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str, | |
| __str + __len, | |
| __os, | |
| __os.fill()) | |
| .failed()) |
[ostream.formatted.reqmts]/3 specifies how padding is to be determined by a formatted output function if the function is specified to determine padding. Thus, the specifications of individual formatted output functions must state explicitly that "padding is to be determined" if output is to be padded. However, vprint_[non]unicode are not specified to "determine padding" in [ostream.formatted.print], so no padding should be applied.
Also note that MSVC STL and libstdc++ do not apply padding.
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.