From Jason Turner

[streambuf.virt.put]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpiqpo1mjf/{from.md → to.md} +21 -3
tmp/tmpiqpo1mjf/{from.md → to.md} RENAMED
@@ -6,13 +6,13 @@ streamsize xsputn(const char_type* s, streamsize n);
6
 
7
  *Effects:* Writes up to `n` characters to the output sequence as if by
8
  repeated calls to `sputc(c)`. The characters written are obtained from
9
  successive elements of the array whose first element is designated by
10
  `s`. Writing stops when either `n` characters have been written or a
11
- call to `sputc(c)` would return `traits::eof()`. Is is unspecified
12
  whether the function calls `overflow()` when `pptr() == epptr()` becomes
13
- true or whether it achieves the same effects by other means.
14
 
15
  *Returns:* The number of characters written.
16
 
17
  ``` cpp
18
  int_type overflow(int_type c = traits::eof());
@@ -20,19 +20,37 @@ int_type overflow(int_type c = traits::eof());
20
 
21
  *Effects:* Consumes some initial subsequence of the characters of the
22
  *pending sequence*. The pending sequence is defined as the concatenation
23
  of
24
 
 
 
 
 
 
25
  *Remarks:* The member functions `sputc()` and `sputn()` call this
26
  function in case that no room can be found in the put buffer enough to
27
  accommodate the argument character sequence.
28
 
29
  *Requires:* Every overriding definition of this virtual function shall
30
  obey the following constraints:
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  *Returns:* `traits::eof()` or throws an exception if the function fails.
33
 
34
  Otherwise, returns some value other than `traits::eof()` to indicate
35
- success.[^16]
36
 
37
  *Default behavior:* Returns `traits::eof()`.
38
 
 
6
 
7
  *Effects:* Writes up to `n` characters to the output sequence as if by
8
  repeated calls to `sputc(c)`. The characters written are obtained from
9
  successive elements of the array whose first element is designated by
10
  `s`. Writing stops when either `n` characters have been written or a
11
+ call to `sputc(c)` would return `traits::eof()`. It is unspecified
12
  whether the function calls `overflow()` when `pptr() == epptr()` becomes
13
+ `true` or whether it achieves the same effects by other means.
14
 
15
  *Returns:* The number of characters written.
16
 
17
  ``` cpp
18
  int_type overflow(int_type c = traits::eof());
 
20
 
21
  *Effects:* Consumes some initial subsequence of the characters of the
22
  *pending sequence*. The pending sequence is defined as the concatenation
23
  of
24
 
25
+ - the empty sequence if `pbase()` is not null, otherwise the
26
+ `pptr() - pbase()` characters beginning at `pbase()`, followed by
27
+ - the empty sequence if `traits::eq_int_type(c, traits::eof())` returns
28
+ `true`, otherwise the sequence consisting of `c`.
29
+
30
  *Remarks:* The member functions `sputc()` and `sputn()` call this
31
  function in case that no room can be found in the put buffer enough to
32
  accommodate the argument character sequence.
33
 
34
  *Requires:* Every overriding definition of this virtual function shall
35
  obey the following constraints:
36
 
37
+ 1. The effect of consuming a character on the associated output
38
+ sequence is specified[^16]
39
+ 2. Let `r` be the number of characters in the pending sequence not
40
+ consumed. If `r` is nonzero then `pbase()` and `pptr()` shall be set
41
+ so that: `pptr() - pbase() == r` and the `r` characters starting at
42
+ `pbase()` are the associated output stream. In case `r` is zero (all
43
+ characters of the pending sequence have been consumed) then either
44
+ `pbase()` is set to `nullptr`, or `pbase()` and `pptr()` are both
45
+ set to the same non-null value.
46
+ 3. The function may fail if either appending some character to the
47
+ associated output stream fails or if it is unable to establish
48
+ `pbase()` and `pptr()` according to the above rules.
49
+
50
  *Returns:* `traits::eof()` or throws an exception if the function fails.
51
 
52
  Otherwise, returns some value other than `traits::eof()` to indicate
53
+ success.[^17]
54
 
55
  *Default behavior:* Returns `traits::eof()`.
56