From Jason Turner

[basic.ios.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2xuktr4g/{from.md → to.md} +35 -36
tmp/tmp2xuktr4g/{from.md → to.md} RENAMED
@@ -9,15 +9,15 @@ sequence controlled by the stream buffer.
9
 
10
  ``` cpp
11
  basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
12
  ```
13
 
14
- *Requires:* If `tiestr` is not null, `tiestr` must not be reachable by
15
  traversing the linked list of tied stream objects starting from
16
  `tiestr->tie()`.
17
 
18
- *Postconditions:* `tiestr == tie()`.
19
 
20
  *Returns:* The previous value of `tie()`.
21
 
22
  ``` cpp
23
  basic_streambuf<charT, traits>* rdbuf() const;
@@ -27,22 +27,22 @@ basic_streambuf<charT, traits>* rdbuf() const;
27
 
28
  ``` cpp
29
  basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
30
  ```
31
 
32
- *Postconditions:* `sb == rdbuf()`.
33
-
34
  *Effects:* Calls `clear()`.
35
 
 
 
36
  *Returns:* The previous value of `rdbuf()`.
37
 
38
  ``` cpp
39
  locale imbue(const locale& loc);
40
  ```
41
 
42
- *Effects:* Calls `ios_base::imbue(loc)` ([[ios.base.locales]]) and if
43
- `rdbuf() != 0` then `rdbuf()->pubimbue(loc)` ([[streambuf.locales]]).
44
 
45
  *Returns:* The prior value of `ios_base::imbue()`.
46
 
47
  ``` cpp
48
  char narrow(char_type c, char dfault) const;
@@ -65,45 +65,45 @@ specified field width.
65
 
66
  ``` cpp
67
  char_type fill(char_type fillch);
68
  ```
69
 
70
- *Postconditions:* `traits::eq(fillch, fill())`.
71
 
72
  *Returns:* The previous value of `fill()`.
73
 
74
  ``` cpp
75
  basic_ios& copyfmt(const basic_ios& rhs);
76
  ```
77
 
78
- *Effects:* If `(this == &rhs)` does nothing. Otherwise assigns to the
79
- member objects of `*this` the corresponding member objects of `rhs` as
80
- follows:
81
 
82
- 1. calls each registered callback pair `(fn, index)` as
83
- `(*fn)(erase_event, *this, index)`;
84
- 2. assigns to the member objects of `*this` the corresponding member
85
- objects of `rhs`, except that
86
  - `rdstate()`, `rdbuf()`, and `exceptions()` are left unchanged;
87
- - the contents of arrays pointed at by `pword` and `iword` are
88
- copied, not the pointers themselves;[^10] and
89
  - if any newly stored pointer values in `*this` point at objects
90
- stored outside the object `rhs` and those objects are destroyed
91
- when `rhs` is destroyed, the newly stored pointer values are
92
- altered to point at newly constructed copies of the objects;
93
- 3. calls each callback pair that was copied from `rhs` as
94
- `(*fn)(copyfmt_event, *this, index)`;
95
- 4. calls `exceptions(rhs.exceptions())`.
96
 
97
  [*Note 1*: The second pass through the callback pairs permits a copied
98
  `pword` value to be zeroed, or to have its referent deep copied or
99
  reference counted, or to have other special action taken. — *end note*]
100
 
101
- *Postconditions:* The postconditions of this function are indicated in
102
- Table  [[tab:iostreams.copyfmt.effects]].
103
 
104
- **Table: `basic_ios::copyfmt()` effects** <a id="tab:iostreams.copyfmt.effects">[tab:iostreams.copyfmt.effects]</a>
105
 
106
  | Element | Value |
107
  | -------------- | ------------------ |
108
  | `rdbuf()` | unchanged |
109
  | `tie()` | `rhs.tie()` |
@@ -121,33 +121,32 @@ Table  [[tab:iostreams.copyfmt.effects]].
121
  ``` cpp
122
  void move(basic_ios& rhs);
123
  void move(basic_ios&& rhs);
124
  ```
125
 
126
- *Postconditions:* `*this` shall have the state that `rhs` had before the
127
- function call, except that `rdbuf()` shall return 0. `rhs` shall be in a
128
- valid but unspecified state, except that `rhs.rdbuf()` shall return the
129
- same value as it returned before the function call, and `rhs.tie()`
130
- shall return 0.
131
 
132
  ``` cpp
133
  void swap(basic_ios& rhs) noexcept;
134
  ```
135
 
136
- *Effects:* The states of `*this` and `rhs` shall be exchanged, except
137
- that `rdbuf()` shall return the same value as it returned before the
138
- function call, and `rhs.rdbuf()` shall return the same value as it
139
- returned before the function call.
140
 
141
  ``` cpp
142
  void set_rdbuf(basic_streambuf<charT, traits>* sb);
143
  ```
144
 
145
- *Requires:* `sb != nullptr`.
146
 
147
  *Effects:* Associates the `basic_streambuf` object pointed to by `sb`
148
  with this stream without calling `clear()`.
149
 
150
- *Postconditions:* `rdbuf() == sb`.
151
 
152
  *Throws:* Nothing.
153
 
 
9
 
10
  ``` cpp
11
  basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
12
  ```
13
 
14
+ *Preconditions:* If `tiestr` is not null, `tiestr` is not reachable by
15
  traversing the linked list of tied stream objects starting from
16
  `tiestr->tie()`.
17
 
18
+ *Ensures:* `tiestr == tie()`.
19
 
20
  *Returns:* The previous value of `tie()`.
21
 
22
  ``` cpp
23
  basic_streambuf<charT, traits>* rdbuf() const;
 
27
 
28
  ``` cpp
29
  basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
30
  ```
31
 
 
 
32
  *Effects:* Calls `clear()`.
33
 
34
+ *Ensures:* `sb == rdbuf()`.
35
+
36
  *Returns:* The previous value of `rdbuf()`.
37
 
38
  ``` cpp
39
  locale imbue(const locale& loc);
40
  ```
41
 
42
+ *Effects:* Calls `ios_base::imbue(loc)` [[ios.base.locales]] and if
43
+ `rdbuf() != 0` then `rdbuf()->pubimbue(loc)` [[streambuf.locales]].
44
 
45
  *Returns:* The prior value of `ios_base::imbue()`.
46
 
47
  ``` cpp
48
  char narrow(char_type c, char dfault) const;
 
65
 
66
  ``` cpp
67
  char_type fill(char_type fillch);
68
  ```
69
 
70
+ *Ensures:* `traits::eq(fillch, fill())`.
71
 
72
  *Returns:* The previous value of `fill()`.
73
 
74
  ``` cpp
75
  basic_ios& copyfmt(const basic_ios& rhs);
76
  ```
77
 
78
+ *Effects:* If `(this == addressof(rhs))` is `true` does nothing.
79
+ Otherwise assigns to the member objects of `*this` the corresponding
80
+ member objects of `rhs` as follows:
81
 
82
+ - calls each registered callback pair `(fn, idx)` as
83
+ `(*fn)(erase_event, *this, idx)`;
84
+ - then, assigns to the member objects of `*this` the corresponding
85
+ member objects of `rhs`, except that
86
  - `rdstate()`, `rdbuf()`, and `exceptions()` are left unchanged;
87
+ - the contents of arrays pointed at by `pword` and `iword` are copied,
88
+ not the pointers themselves;[^10] and
89
  - if any newly stored pointer values in `*this` point at objects
90
+ stored outside the object `rhs` and those objects are destroyed when
91
+ `rhs` is destroyed, the newly stored pointer values are altered to
92
+ point at newly constructed copies of the objects;
93
+ - then, calls each callback pair that was copied from `rhs` as
94
+ `(*fn)(copyfmt_event, *this, idx)`;
95
+ - then, calls `exceptions(rhs.exceptions())`.
96
 
97
  [*Note 1*: The second pass through the callback pairs permits a copied
98
  `pword` value to be zeroed, or to have its referent deep copied or
99
  reference counted, or to have other special action taken. — *end note*]
100
 
101
+ *Ensures:* The postconditions of this function are indicated in
102
+ [[basic.ios.copyfmt]].
103
 
104
+ **Table: `basic_ios::copyfmt()` effects** <a id="basic.ios.copyfmt">[basic.ios.copyfmt]</a>
105
 
106
  | Element | Value |
107
  | -------------- | ------------------ |
108
  | `rdbuf()` | unchanged |
109
  | `tie()` | `rhs.tie()` |
 
121
  ``` cpp
122
  void move(basic_ios& rhs);
123
  void move(basic_ios&& rhs);
124
  ```
125
 
126
+ *Ensures:* `*this` has the state that `rhs` had before the function
127
+ call, except that `rdbuf()` returns `nullptr`. `rhs` is in a valid but
128
+ unspecified state, except that `rhs.rdbuf()` returns the same value as
129
+ it returned before the function call, and `rhs.tie()` returns `nullptr`.
 
130
 
131
  ``` cpp
132
  void swap(basic_ios& rhs) noexcept;
133
  ```
134
 
135
+ *Effects:* The states of `*this` and `rhs` are exchanged, except that
136
+ `rdbuf()` returns the same value as it returned before the function
137
+ call, and `rhs.rdbuf()` returns the same value as it returned before the
138
+ function call.
139
 
140
  ``` cpp
141
  void set_rdbuf(basic_streambuf<charT, traits>* sb);
142
  ```
143
 
144
+ *Preconditions:* `sb != nullptr` is `true`.
145
 
146
  *Effects:* Associates the `basic_streambuf` object pointed to by `sb`
147
  with this stream without calling `clear()`.
148
 
149
+ *Ensures:* `rdbuf() == sb` is `true`.
150
 
151
  *Throws:* Nothing.
152