This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
Section: 31.4 [iostream.objects] Status: CD1 Submitter: Pete Becker Opened: 2006-04-18 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [iostream.objects].
View all issues with CD1 status.
Discussion:
lib.iostream.objects requires that the standard stream objects are never destroyed, and it requires that they be destroyed.
DR 369 adds words to say that we really mean for ios_base::Init
objects to force
construction of standard stream objects. It ends, though, with the phrase "these
stream objects shall be destroyed after the destruction of dynamically ...".
However, the rule for destruction is stated in the standard: "The objects are
not destroyed during program execution."
Proposed resolution:
Change 31.4 [iostream.objects]/1:
-2- 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.290) The objects are not destroyed during program execution.291) If a translation unit includes<iostream>
or explicitly constructs anios_base::Init
object, these stream objects shall be constructed before dynamic initialization of non-local objects defined later in that translation unit, and these stream objects shall be destroyed after the destruction of dynamically initialized non-local objects defined later in that translation unit.
[ Kona (2007): From 31.4 [iostream.objects]/2, strike the words "...and these stream objects shall be destroyed after the destruction of dynamically initialized non-local objects defined later in that translation unit." Proposed Disposition: Review ]