From Jason Turner

[facet.num.get.virtuals]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_zzzqq05/{from.md → to.md} +35 -27
tmp/tmp_zzzqq05/{from.md → to.md} RENAMED
@@ -83,12 +83,12 @@ as indicated in Table [[tab:localization.length.modifier.in]].
83
  | `double` | `l` |
84
  | `long double` | `L` |
85
 
86
  - **Stage 2:**
87
 
88
- If `in==end` then stage 2 terminates. Otherwise a `charT` is taken from
89
- `in` and local variables are initialized as if by
90
 
91
  ``` cpp
92
  char_type ct = *in;
93
  char c = src[find(atoms, atoms + sizeof(src) - 1, ct) - atoms];
94
  if (ct == use_facet<numpunct<charT>>(loc).decimal_point())
@@ -106,11 +106,11 @@ char_type atoms[sizeof(src)];
106
  use_facet<ctype<charT>>(loc).widen(src, src + sizeof(src), atoms);
107
  ```
108
 
109
  for this value of `loc`.
110
 
111
- If `discard` is true, then if `’.’` has not yet been accumulated, then
112
  the position of the character is remembered, but the character is
113
  otherwise ignored. Otherwise, if `’.’` has already been accumulated, the
114
  character is discarded and Stage 2 terminates. If it is not discarded,
115
  then a check is made to determine if `c` is allowed as the next
116
  character of an input field of the conversion specifier returned by
@@ -127,54 +127,60 @@ header `<cstdlib>`:
127
 
128
  - For a signed integer value, the function `strtoll`.
129
 
130
  - For an unsigned integer value, the function `strtoull`.
131
 
132
- - For a floating-point value, the function `strtold`.
 
 
 
 
133
 
134
  The numeric value to be stored can be one of:
135
 
136
- - zero, if the conversion function fails to convert the entire field.
137
- `ios_base::failbit` is assigned to `err`.
138
 
139
- - the most positive representable value, if the field represents a value
140
- too large positive to be represented in `val`. `ios_base::failbit` is
141
- assigned to `err`.
142
 
143
- - the most negative representable value or zero for an unsigned integer
144
- type, if the field represents a value too large negative to be
145
- represented in `val`. `ios_base::failbit` is assigned to `err`.
146
 
147
  - the converted value, otherwise.
148
 
149
- The resultant numeric value is stored in `val`.
 
 
 
150
 
151
  Digit grouping is checked. That is, the positions of discarded
152
  separators is examined for consistency with
153
- `use_facet<numpunct<charT> >(loc).grouping()`. If they are not
154
- consistent then `ios_base::failbit` is assigned to `err`.
155
 
156
  In any case, if stage 2 processing was terminated by the test for
157
  `in == end` then `err |= ios_base::eofbit` is performed.
158
 
159
  ``` cpp
160
  iter_type do_get(iter_type in, iter_type end, ios_base& str,
161
  ios_base::iostate& err, bool& val) const;
162
  ```
163
 
164
- *Effects:* If `(str``.flags()&ios_base::boolalpha)==0` then input
165
  proceeds as it would for a `long` except that if a value is being stored
166
  into `val`, the value is determined according to the following: If the
167
- value to be stored is 0 then `false` is stored. If the value is 1 then
168
  `true` is stored. Otherwise `true` is stored and `ios_base::failbit` is
169
  assigned to `err`.
170
 
171
  Otherwise target sequences are determined “as if” by calling the members
172
  `falsename()` and `truename()` of the facet obtained by
173
- `use_facet<numpunct<charT> >(str.getloc())`. Successive characters in
174
- the range \[`in`, `end`) (see  [[sequence.reqmts]]) are obtained and
175
- matched against corresponding positions in the target sequences only as
176
  necessary to identify a unique match. The input iterator `in` is
177
  compared to `end` only when necessary to obtain a character. If a target
178
  sequence is uniquely matched, `val` is set to the corresponding value.
179
  Otherwise `false` is stored and `ios_base::failbit` is assigned to
180
  `err`.
@@ -182,15 +188,17 @@ Otherwise `false` is stored and `ios_base::failbit` is assigned to
182
  The `in` iterator is always left pointing one position beyond the last
183
  character successfully matched. If `val` is set, then `err` is set to
184
  `str.goodbit`; or to `str.eofbit` if, when seeking another character to
185
  match, it is found that `(in == end)`. If `val` is not set, then `err`
186
  is set to `str.failbit`; or to `(str.failbit|str.eofbit)` if the reason
187
- for the failure was that `(in == end)`. For targets `true`: `"a"` and
188
- `false`: `"abb"`, the input sequence `"a"` yields `val == true` and
189
- `err == str.eofbit`; the input sequence `"abc"` yields
190
- `err = str.failbit`, with `in` ending at the `’c’` element. For targets
191
- `true`: `"1"` and `false`: `"0"`, the input sequence `"1"` yields
192
- `val == true` and `err == str.goodbit`. For empty targets `("")`, any
193
- input sequence yields `err == str.failbit`.
 
 
194
 
195
  *Returns:* `in`.
196
 
 
83
  | `double` | `l` |
84
  | `long double` | `L` |
85
 
86
  - **Stage 2:**
87
 
88
+ If `in == end` then stage 2 terminates. Otherwise a `charT` is taken
89
+ from `in` and local variables are initialized as if by
90
 
91
  ``` cpp
92
  char_type ct = *in;
93
  char c = src[find(atoms, atoms + sizeof(src) - 1, ct) - atoms];
94
  if (ct == use_facet<numpunct<charT>>(loc).decimal_point())
 
106
  use_facet<ctype<charT>>(loc).widen(src, src + sizeof(src), atoms);
107
  ```
108
 
109
  for this value of `loc`.
110
 
111
+ If `discard` is `true`, then if `’.’` has not yet been accumulated, then
112
  the position of the character is remembered, but the character is
113
  otherwise ignored. Otherwise, if `’.’` has already been accumulated, the
114
  character is discarded and Stage 2 terminates. If it is not discarded,
115
  then a check is made to determine if `c` is allowed as the next
116
  character of an input field of the conversion specifier returned by
 
127
 
128
  - For a signed integer value, the function `strtoll`.
129
 
130
  - For an unsigned integer value, the function `strtoull`.
131
 
132
+ - For a `float` value, the function `strtof`.
133
+
134
+ - For a `double` value, the function `strtod`.
135
+
136
+ - For a `long double` value, the function `strtold`.
137
 
138
  The numeric value to be stored can be one of:
139
 
140
+ - zero, if the conversion function does not convert the entire field.
 
141
 
142
+ - the most positive (or negative) representable value, if the field to
143
+ be converted to a signed integer type represents a value too large
144
+ positive (or negative) to be represented in `val`.
145
 
146
+ - the most positive representable value, if the field to be converted to
147
+ an unsigned integer type represents a value that cannot be represented
148
+ in `val`.
149
 
150
  - the converted value, otherwise.
151
 
152
+ The resultant numeric value is stored in `val`. If the conversion
153
+ function does not convert the entire field, or if the field represents a
154
+ value outside the range of representable values, `ios_base::failbit` is
155
+ assigned to `err`.
156
 
157
  Digit grouping is checked. That is, the positions of discarded
158
  separators is examined for consistency with
159
+ `use_facet<numpunct<charT>>(loc).grouping()`. If they are not consistent
160
+ then `ios_base::failbit` is assigned to `err`.
161
 
162
  In any case, if stage 2 processing was terminated by the test for
163
  `in == end` then `err |= ios_base::eofbit` is performed.
164
 
165
  ``` cpp
166
  iter_type do_get(iter_type in, iter_type end, ios_base& str,
167
  ios_base::iostate& err, bool& val) const;
168
  ```
169
 
170
+ *Effects:* If `(str.flags()&ios_base::boolalpha) == 0` then input
171
  proceeds as it would for a `long` except that if a value is being stored
172
  into `val`, the value is determined according to the following: If the
173
+ value to be stored is 0 then `false` is stored. If the value is `1` then
174
  `true` is stored. Otherwise `true` is stored and `ios_base::failbit` is
175
  assigned to `err`.
176
 
177
  Otherwise target sequences are determined “as if” by calling the members
178
  `falsename()` and `truename()` of the facet obtained by
179
+ `use_facet<numpunct<charT>>(str.getloc())`. Successive characters in the
180
+ range \[`in`, `end`) (see  [[sequence.reqmts]]) are obtained and matched
181
+ against corresponding positions in the target sequences only as
182
  necessary to identify a unique match. The input iterator `in` is
183
  compared to `end` only when necessary to obtain a character. If a target
184
  sequence is uniquely matched, `val` is set to the corresponding value.
185
  Otherwise `false` is stored and `ios_base::failbit` is assigned to
186
  `err`.
 
188
  The `in` iterator is always left pointing one position beyond the last
189
  character successfully matched. If `val` is set, then `err` is set to
190
  `str.goodbit`; or to `str.eofbit` if, when seeking another character to
191
  match, it is found that `(in == end)`. If `val` is not set, then `err`
192
  is set to `str.failbit`; or to `(str.failbit|str.eofbit)` if the reason
193
+ for the failure was that `(in == end)`.
194
+
195
+ [*Example 1*: For targets `true`: `"a"` and `false`: `"abb"`, the input
196
+ sequence `"a"` yields `val == true` and `err == str.eofbit`; the input
197
+ sequence `"abc"` yields `err = str.failbit`, with `in` ending at the
198
+ `’c’` element. For targets `true`: `"1"` and `false`: `"0"`, the input
199
+ sequence `"1"` yields `val == true` and `err == str.goodbit`. For empty
200
+ targets `("")`, any input sequence yields
201
+ `err == str.failbit`. — *end example*]
202
 
203
  *Returns:* `in`.
204