Title
I/O manipulators should be specified in terms of base classes
Status
new
Section
[std.manip] [ext.manip] [quoted.manip]
Submitter
Jonathan Wakely

Created on 2023-05-25.00:00:00 last changed 11 months ago

Messages

Date: 2023-06-15.00:00:00

[ 2023-06-01; Reflector poll ]

Set priority to 3 after reflector poll.

Date: 2023-05-25.00:00:00

All the manipulators in [std.manip] and [ext.manip] use language of the form:

An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << resetiosflags(mask) behaves as if [...]

This needs to work for any object with a public and unambiguous base class of type basic_ostream<charT, traits>, not only objects of exactly that type.

In C++98 and C++03, setfill did actually get this right ("if out is (or is derived from) basic_ostream<charT,traits>"), but that was "fixed" for C++11 to be consistent with the other manipulators.

[quoted.manip] is slightly different, talking about "an instance of basic_ostream", but that's not right either.

History
Date User Action Args
2023-06-01 14:06:54adminsetmessages: + msg13602
2023-05-25 00:00:00admincreate