tmp/tmpmeoze2zz/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
#### Class template `num_get` <a id="locale.num.get">[[locale.num.get]]</a>
|
| 2 |
|
| 3 |
-
##### General <a id="locale.num.get.general">[[locale.num.get.general]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 8 |
class num_get : public locale::facet {
|
|
@@ -66,11 +66,11 @@ namespace std {
|
|
| 66 |
```
|
| 67 |
|
| 68 |
The facet `num_get` is used to parse numeric values from an input
|
| 69 |
sequence such as an istream.
|
| 70 |
|
| 71 |
-
##### Members <a id="facet.num.get.members">[[facet.num.get.members]]</a>
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
| 75 |
ios_base::iostate& err, bool& val) const;
|
| 76 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
@@ -95,11 +95,11 @@ iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
| 95 |
ios_base::iostate& err, void*& val) const;
|
| 96 |
```
|
| 97 |
|
| 98 |
*Returns:* `do_get(in, end, str, err, val)`.
|
| 99 |
|
| 100 |
-
##### Virtual functions <a id="facet.num.get.virtuals">[[facet.num.get.virtuals]]</a>
|
| 101 |
|
| 102 |
``` cpp
|
| 103 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
| 104 |
ios_base::iostate& err, long& val) const;
|
| 105 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
@@ -124,17 +124,17 @@ iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
| 124 |
|
| 125 |
*Effects:* Reads characters from `in`, interpreting them according to
|
| 126 |
`str.flags()`, `use_facet<ctype<charT>>(loc)`, and
|
| 127 |
`use_facet<numpunct<charT>>(loc)`, where `loc` is `str.getloc()`.
|
| 128 |
|
| 129 |
-
The details of this operation occur in three stages
|
| 130 |
|
| 131 |
-
- Stage 1: Determine a conversion specifier
|
| 132 |
- Stage 2: Extract characters from `in` and determine a corresponding
|
| 133 |
`char` value for the format expected by the conversion specification
|
| 134 |
determined in stage 1.
|
| 135 |
-
- Stage 3: Store results
|
| 136 |
|
| 137 |
The details of the stages are presented below.
|
| 138 |
|
| 139 |
[*Example 1*:
|
| 140 |
|
|
@@ -184,12 +184,12 @@ Otherwise `false` is stored and `ios_base::failbit` is assigned to
|
|
| 184 |
|
| 185 |
The `in` iterator is always left pointing one position beyond the last
|
| 186 |
character successfully matched. If `val` is set, then `err` is set to
|
| 187 |
`str.goodbit`; or to `str.eofbit` if, when seeking another character to
|
| 188 |
match, it is found that `(in == end)`. If `val` is not set, then `err`
|
| 189 |
-
is set to `str.failbit`; or to `(str.failbit|str.eofbit)` if the
|
| 190 |
-
for the failure was that `(in == end)`.
|
| 191 |
|
| 192 |
[*Example 2*: For targets `true`: `"a"` and `false`: `"abb"`, the input
|
| 193 |
sequence `"a"` yields `val == true` and `err == str.eofbit`; the input
|
| 194 |
sequence `"abc"` yields `err = str.failbit`, with `in` ending at the
|
| 195 |
`’c’` element. For targets `true`: `"1"` and `false`: `"0"`, the input
|
|
|
|
| 1 |
+
##### Class template `num_get` <a id="locale.num.get">[[locale.num.get]]</a>
|
| 2 |
|
| 3 |
+
###### General <a id="locale.num.get.general">[[locale.num.get.general]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 8 |
class num_get : public locale::facet {
|
|
|
|
| 66 |
```
|
| 67 |
|
| 68 |
The facet `num_get` is used to parse numeric values from an input
|
| 69 |
sequence such as an istream.
|
| 70 |
|
| 71 |
+
###### Members <a id="facet.num.get.members">[[facet.num.get.members]]</a>
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
| 75 |
ios_base::iostate& err, bool& val) const;
|
| 76 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
|
|
| 95 |
ios_base::iostate& err, void*& val) const;
|
| 96 |
```
|
| 97 |
|
| 98 |
*Returns:* `do_get(in, end, str, err, val)`.
|
| 99 |
|
| 100 |
+
###### Virtual functions <a id="facet.num.get.virtuals">[[facet.num.get.virtuals]]</a>
|
| 101 |
|
| 102 |
``` cpp
|
| 103 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
| 104 |
ios_base::iostate& err, long& val) const;
|
| 105 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
|
|
| 124 |
|
| 125 |
*Effects:* Reads characters from `in`, interpreting them according to
|
| 126 |
`str.flags()`, `use_facet<ctype<charT>>(loc)`, and
|
| 127 |
`use_facet<numpunct<charT>>(loc)`, where `loc` is `str.getloc()`.
|
| 128 |
|
| 129 |
+
The details of this operation occur in three stages:
|
| 130 |
|
| 131 |
+
- Stage 1: Determine a conversion specifier.
|
| 132 |
- Stage 2: Extract characters from `in` and determine a corresponding
|
| 133 |
`char` value for the format expected by the conversion specification
|
| 134 |
determined in stage 1.
|
| 135 |
+
- Stage 3: Store results.
|
| 136 |
|
| 137 |
The details of the stages are presented below.
|
| 138 |
|
| 139 |
[*Example 1*:
|
| 140 |
|
|
|
|
| 184 |
|
| 185 |
The `in` iterator is always left pointing one position beyond the last
|
| 186 |
character successfully matched. If `val` is set, then `err` is set to
|
| 187 |
`str.goodbit`; or to `str.eofbit` if, when seeking another character to
|
| 188 |
match, it is found that `(in == end)`. If `val` is not set, then `err`
|
| 189 |
+
is set to `str.failbit`; or to `(str.failbit | str.eofbit)` if the
|
| 190 |
+
reason for the failure was that `(in == end)`.
|
| 191 |
|
| 192 |
[*Example 2*: For targets `true`: `"a"` and `false`: `"abb"`, the input
|
| 193 |
sequence `"a"` yields `val == true` and `err == str.eofbit`; the input
|
| 194 |
sequence `"abc"` yields `err = str.failbit`, with `in` ending at the
|
| 195 |
`’c’` element. For targets `true`: `"1"` and `false`: `"0"`, the input
|