Created on 2016-08-13.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4606.
Modify [ios::Init] p3 as indicated:
-3- The objects are constructed and the associations are established at some time prior to or during the first time an object of class ios_base::Init is constructed, and in any case before the body of main begins execution.(footnote 293) The objects are not destroyed during program execution.(footnote 294) The results of including <iostream> in a translation unit shall be as if <iostream> defined an instance of ios_base::Init with static storage duration.
Similarly, the entire program shall behave as if there were at least one instance of ios_base::Init with static storage duration.
[ 2016-09-09 Issues Resolution Telecon ]
P0; move to Tentatively Ready
1123 fixed a bug where users of <iostream> were not guaranteed to have their streams flushed on program shutdown. However, it also added this rule:
"Similarly, the entire program shall behave as if there were at least one instance of ios_base::Init with static lifetime."
This seems pointless: it only affects the behavior of programs that never include <iostream> (because programs that do include it are already guaranteed at least one such instance), and those programs do not need an implicit flush because they cannot have written to the relevant streams.
It's also actively harmful, because it requires the iostreams component to be linked into programs that do not use it, apparently even including freestanding implementations! Fortunately, C++ implementations appear to uniformly ignore this rule. Can it be removed?History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-09-12 18:40:18 | admin | set | messages: + msg8520 |
2016-09-12 04:36:33 | admin | set | messages: + msg8507 |
2016-09-12 04:36:33 | admin | set | status: new -> ready |
2016-08-13 00:00:00 | admin | create |