From Jason Turner

[iostreams.requirements]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp30uerv6y/{from.md → to.md} +28 -4
tmp/tmp30uerv6y/{from.md → to.md} RENAMED
@@ -7,30 +7,54 @@ and `basic_filebuf::pubimbue` causes any instance of `basic_ios::imbue`
7
  or `basic_streambuf::imbue` to be called. If any user function called
8
  from a function declared in [[input.output]] or as an overriding virtual
9
  function of any class declared in [[input.output]] calls `imbue`, the
10
  behavior is undefined.
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ### Positioning type limitations <a id="iostreams.limits.pos">[[iostreams.limits.pos]]</a>
13
 
14
  The classes of [[input.output]] with template arguments `charT` and
15
  `traits` behave as described if `traits::pos_type` and
16
  `traits::off_type` are `streampos` and `streamoff` respectively. Except
17
  as noted explicitly below, their behavior when `traits::pos_type` and
18
  `traits::off_type` are other types is *implementation-defined*.
19
 
 
 
 
 
 
20
  In the classes of [[input.output]], a template parameter with name
21
  `charT` represents a member of the set of types containing `char`,
22
  `wchar_t`, and any other *implementation-defined* character types that
23
  meet the requirements for a character on which any of the iostream
24
  components can be instantiated.
25
 
26
  ### Thread safety <a id="iostreams.threadsafety">[[iostreams.threadsafety]]</a>
27
 
28
- Concurrent access to a stream object ([[string.streams]],
29
- [[file.streams]]), stream buffer object [[stream.buffers]], or C Library
30
- stream [[c.files]] by multiple threads may result in a data race
31
- [[intro.multithread]] unless otherwise specified [[iostream.objects]].
 
32
 
33
  [*Note 1*: Data races result in undefined behavior
34
  [[intro.multithread]]. — *end note*]
35
 
36
  If one thread makes a library call *a* that writes a value to a stream
 
7
  or `basic_streambuf::imbue` to be called. If any user function called
8
  from a function declared in [[input.output]] or as an overriding virtual
9
  function of any class declared in [[input.output]] calls `imbue`, the
10
  behavior is undefined.
11
 
12
+ ### Types <a id="stream.types">[[stream.types]]</a>
13
+
14
+ ``` cpp
15
+ using streamoff = implementation-defined // type of streamoff;
16
+ ```
17
+
18
+ The type `streamoff` is a synonym for one of the signed basic integral
19
+ types of sufficient size to represent the maximum possible file size for
20
+ the operating system.[^1]
21
+
22
+ ``` cpp
23
+ using streamsize = implementation-defined;
24
+ ```
25
+
26
+ The type `streamsize` is a synonym for one of the signed basic integral
27
+ types. It is used to represent the number of characters transferred in
28
+ an I/O operation, or the size of I/O buffers.[^2]
29
+
30
  ### Positioning type limitations <a id="iostreams.limits.pos">[[iostreams.limits.pos]]</a>
31
 
32
  The classes of [[input.output]] with template arguments `charT` and
33
  `traits` behave as described if `traits::pos_type` and
34
  `traits::off_type` are `streampos` and `streamoff` respectively. Except
35
  as noted explicitly below, their behavior when `traits::pos_type` and
36
  `traits::off_type` are other types is *implementation-defined*.
37
 
38
+ [*Note 1*: For each of the specializations of `char_traits` defined in
39
+ [[char.traits.specializations]], `state_type` denotes `mbstate_t`,
40
+ `pos_type` denotes `fpos<mbstate_t>`, and `off_type` denotes
41
+ `streamoff`. — *end note*]
42
+
43
  In the classes of [[input.output]], a template parameter with name
44
  `charT` represents a member of the set of types containing `char`,
45
  `wchar_t`, and any other *implementation-defined* character types that
46
  meet the requirements for a character on which any of the iostream
47
  components can be instantiated.
48
 
49
  ### Thread safety <a id="iostreams.threadsafety">[[iostreams.threadsafety]]</a>
50
 
51
+ Concurrent access to a stream object
52
+ [[string.streams]], [[file.streams]], stream buffer object
53
+ [[stream.buffers]], or C Library stream [[c.files]] by multiple threads
54
+ may result in a data race [[intro.multithread]] unless otherwise
55
+ specified [[iostream.objects]].
56
 
57
  [*Note 1*: Data races result in undefined behavior
58
  [[intro.multithread]]. — *end note*]
59
 
60
  If one thread makes a library call *a* that writes a value to a stream