tmp/tmpq8g0fewl/{from.md → to.md}
RENAMED
|
@@ -8,25 +8,38 @@ standard C streams provided for by the functions declared in `<cstdio>`,
|
|
| 8 |
and includes all the headers necessary to use these objects.
|
| 9 |
|
| 10 |
The objects are constructed and the associations are established at some
|
| 11 |
time prior to or during the first time an object of class
|
| 12 |
`ios_base::Init` is constructed, and in any case before the body of
|
| 13 |
-
`main` [[basic.start.main]] begins execution.
|
| 14 |
-
destroyed during program execution.[^
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
Mixing operations on corresponding wide- and narrow-character streams
|
| 19 |
follows the same semantics as mixing such operations on `FILE`s, as
|
| 20 |
specified in the C standard library.
|
| 21 |
|
| 22 |
Concurrent access to a synchronized [[ios.members.static]] standard
|
| 23 |
iostream object’s formatted and unformatted input [[istream]] and output
|
| 24 |
[[ostream]] functions or a standard C stream by multiple threads does
|
| 25 |
not result in a data race [[intro.multithread]].
|
| 26 |
|
| 27 |
-
[*Note
|
| 28 |
-
|
| 29 |
-
characters. — *end note*]
|
| 30 |
|
| 31 |
See also: ISO C 7.21.2
|
| 32 |
|
|
|
|
| 8 |
and includes all the headers necessary to use these objects.
|
| 9 |
|
| 10 |
The objects are constructed and the associations are established at some
|
| 11 |
time prior to or during the first time an object of class
|
| 12 |
`ios_base::Init` is constructed, and in any case before the body of
|
| 13 |
+
`main` [[basic.start.main]] begins execution. The objects are not
|
| 14 |
+
destroyed during program execution.[^4]
|
| 15 |
+
|
| 16 |
+
*Recommended practice:* If it is possible for them to do so,
|
| 17 |
+
implementations should initialize the objects earlier than required.
|
| 18 |
+
|
| 19 |
+
The results of including `<iostream>` in a translation unit shall be as
|
| 20 |
+
if `<iostream>` defined an instance of `ios_base::Init` with static
|
| 21 |
+
storage duration. Each C++ library module [[std.modules]] in a hosted
|
| 22 |
+
implementation shall behave as if it contains an interface unit that
|
| 23 |
+
defines an unexported `ios_base::Init` variable with ordered
|
| 24 |
+
initialization [[basic.start.dynamic]].
|
| 25 |
+
|
| 26 |
+
[*Note 1*: As a result, the definition of that variable is
|
| 27 |
+
appearance-ordered before any declaration following the point of
|
| 28 |
+
importation of a C++ library module. Whether such a definition exists is
|
| 29 |
+
unobservable by a program that does not reference any of the standard
|
| 30 |
+
iostream objects. — *end note*]
|
| 31 |
|
| 32 |
Mixing operations on corresponding wide- and narrow-character streams
|
| 33 |
follows the same semantics as mixing such operations on `FILE`s, as
|
| 34 |
specified in the C standard library.
|
| 35 |
|
| 36 |
Concurrent access to a synchronized [[ios.members.static]] standard
|
| 37 |
iostream object’s formatted and unformatted input [[istream]] and output
|
| 38 |
[[ostream]] functions or a standard C stream by multiple threads does
|
| 39 |
not result in a data race [[intro.multithread]].
|
| 40 |
|
| 41 |
+
[*Note 2*: Unsynchronized concurrent use of these objects and streams
|
| 42 |
+
by multiple threads can result in interleaved characters. — *end note*]
|
|
|
|
| 43 |
|
| 44 |
See also: ISO C 7.21.2
|
| 45 |
|