From Jason Turner

[iostream.objects]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp1p34sm0m/{from.md → to.md} +20 -7
tmp/tmp1p34sm0m/{from.md → to.md} RENAMED
@@ -31,27 +31,40 @@ standard C streams provided for by the functions declared in `<cstdio>`,
31
  and includes all the headers necessary to use these objects.
32
 
33
  The objects are constructed and the associations are established at some
34
  time prior to or during the first time an object of class
35
  `ios_base::Init` is constructed, and in any case before the body of
36
- `main` [[basic.start.main]] begins execution.[^2] The objects are not
37
- destroyed during program execution.[^3] The results of including
38
- `<iostream>` in a translation unit shall be as if `<iostream>` defined
39
- an instance of `ios_base::Init` with static storage duration.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  Mixing operations on corresponding wide- and narrow-character streams
42
  follows the same semantics as mixing such operations on `FILE`s, as
43
  specified in the C standard library.
44
 
45
  Concurrent access to a synchronized [[ios.members.static]] standard
46
  iostream object’s formatted and unformatted input [[istream]] and output
47
  [[ostream]] functions or a standard C stream by multiple threads does
48
  not result in a data race [[intro.multithread]].
49
 
50
- [*Note 1*: Users must still synchronize concurrent use of these objects
51
- and streams by multiple threads if they wish to avoid interleaved
52
- characters. — *end note*]
53
 
54
  See also: ISO C 7.21.2
55
 
56
  ### Narrow stream objects <a id="narrow.stream.objects">[[narrow.stream.objects]]</a>
57
 
 
31
  and includes all the headers necessary to use these objects.
32
 
33
  The objects are constructed and the associations are established at some
34
  time prior to or during the first time an object of class
35
  `ios_base::Init` is constructed, and in any case before the body of
36
+ `main` [[basic.start.main]] begins execution. The objects are not
37
+ destroyed during program execution.[^4]
38
+
39
+ *Recommended practice:* If it is possible for them to do so,
40
+ implementations should initialize the objects earlier than required.
41
+
42
+ The results of including `<iostream>` in a translation unit shall be as
43
+ if `<iostream>` defined an instance of `ios_base::Init` with static
44
+ storage duration. Each C++ library module [[std.modules]] in a hosted
45
+ implementation shall behave as if it contains an interface unit that
46
+ defines an unexported `ios_base::Init` variable with ordered
47
+ initialization [[basic.start.dynamic]].
48
+
49
+ [*Note 1*: As a result, the definition of that variable is
50
+ appearance-ordered before any declaration following the point of
51
+ importation of a C++ library module. Whether such a definition exists is
52
+ unobservable by a program that does not reference any of the standard
53
+ iostream objects. — *end note*]
54
 
55
  Mixing operations on corresponding wide- and narrow-character streams
56
  follows the same semantics as mixing such operations on `FILE`s, as
57
  specified in the C standard library.
58
 
59
  Concurrent access to a synchronized [[ios.members.static]] standard
60
  iostream object’s formatted and unformatted input [[istream]] and output
61
  [[ostream]] functions or a standard C stream by multiple threads does
62
  not result in a data race [[intro.multithread]].
63
 
64
+ [*Note 2*: Unsynchronized concurrent use of these objects and streams
65
+ by multiple threads can result in interleaved characters. — *end note*]
 
66
 
67
  See also: ISO C 7.21.2
68
 
69
  ### Narrow stream objects <a id="narrow.stream.objects">[[narrow.stream.objects]]</a>
70