Created on 2023-02-09.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to n4928.
Modify [iostream.objects.overview]p5 as indicated:
-5- 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. Each C++ library module ([std.modules]) in a hosted implementation shall behave as if it contains an interface unit that defines an unexported ios_base::Init variable with ordered initialization ([basic.start.dynamic]).
[Note ?: As a result, the definition of that variable is appearance-ordered before any declaration following the point of importation of a C++ library module. Whether such a definition exists is unobservable by a program that does not reference any of the standard iostream objects. — end note][ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]
[ Issaquah 2023-02-09; LWG ]
Move to Immediate for C++23
[ 2023-02-09 Tim updates wording following LWG discussion ]
In the old world, #include <iostream> behaves as if it defined a static-storage-duration ios_base::Init object, which causes the standard iostreams objects to be initialized (if necessary) on startup and flushed on shutdown.
But we don't include headers with import std;, so we need separate wording to provide this guarantee. The proposed resolution below was adapted from a suggestion by Mathias Stearn on the reflector.History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 11:31:32 | admin | set | messages: + msg13403 |
2023-02-13 11:31:32 | admin | set | status: immediate -> wp |
2023-02-10 09:41:49 | admin | set | messages: + msg13331 |
2023-02-10 09:41:49 | admin | set | status: new -> immediate |
2023-02-10 00:11:33 | admin | set | messages: + msg13319 |
2023-02-09 18:13:52 | admin | set | messages: + msg13314 |
2023-02-09 00:00:00 | admin | create |