Skip to content

Commit aaf544e

Browse files
burblebeetkoeppe
authored andcommitted
LWG3878 import std; should guarantee initialization of standard iostreams objects
1 parent 1e27830 commit aaf544e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/iostreams.tex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,17 @@
506506
The results of including \libheader{iostream} in a translation unit shall be as if
507507
\libheader{iostream} defined an instance of \tcode{ios_base::Init} with static
508508
storage duration.
509+
Each \Cpp{} library module\iref{std.modules} in a hosted implementation
510+
shall behave as if it contains an interface unit that
511+
defines an unexported \tcode{ios_base::Init} variable with
512+
ordered initialization\iref{basic.start.dynamic}.
513+
514+
\begin{note}
515+
As a result, the definition of that variable is appearance-ordered before
516+
any declaration following the point of importation of a \Cpp{} library module.
517+
Whether such a definition exists is unobservable by a program that
518+
does not reference any of the standard iostream objects.
519+
\end{note}
509520

510521
\pnum
511522
Mixing operations on corresponding wide- and narrow-character streams

0 commit comments

Comments
 (0)