tmp/tmpkxa7xmpx/{from.md → to.md}
RENAMED
|
@@ -20,32 +20,36 @@ stream data. These extractors behave as formatted input functions (as
|
|
| 20 |
described in [[istream.formatted.reqmts]]). After a sentry object is
|
| 21 |
constructed, the conversion occurs as if performed by the following code
|
| 22 |
fragment:
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
-
|
| 26 |
iostate err = iostate::goodbit;
|
| 27 |
use_facet<numget>(loc).get(*this, 0, *this, err, val);
|
| 28 |
setstate(err);
|
| 29 |
```
|
| 30 |
|
| 31 |
In the above fragment, `loc` stands for the private member of the
|
| 32 |
-
`basic_ios` class.
|
|
|
|
|
|
|
| 33 |
`istreambuf_iterator` class which is an iterator pointed to an input
|
| 34 |
-
stream. It bypasses istreams and uses streambufs
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
operator>>(short& val);
|
| 40 |
```
|
| 41 |
|
| 42 |
The conversion occurs as if performed by the following code fragment
|
| 43 |
(using the same notation as for the preceding code fragment):
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
-
|
| 47 |
iostate err = ios_base::goodbit;
|
| 48 |
long lval;
|
| 49 |
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
|
| 50 |
if (lval < numeric_limits<short>::min()) {
|
| 51 |
err |= ios_base::failbit;
|
|
@@ -64,11 +68,11 @@ operator>>(int& val);
|
|
| 64 |
|
| 65 |
The conversion occurs as if performed by the following code fragment
|
| 66 |
(using the same notation as for the preceding code fragment):
|
| 67 |
|
| 68 |
``` cpp
|
| 69 |
-
|
| 70 |
iostate err = ios_base::goodbit;
|
| 71 |
long lval;
|
| 72 |
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
|
| 73 |
if (lval < numeric_limits<int>::min()) {
|
| 74 |
err |= ios_base::failbit;
|
|
|
|
| 20 |
described in [[istream.formatted.reqmts]]). After a sentry object is
|
| 21 |
constructed, the conversion occurs as if performed by the following code
|
| 22 |
fragment:
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
+
using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
|
| 26 |
iostate err = iostate::goodbit;
|
| 27 |
use_facet<numget>(loc).get(*this, 0, *this, err, val);
|
| 28 |
setstate(err);
|
| 29 |
```
|
| 30 |
|
| 31 |
In the above fragment, `loc` stands for the private member of the
|
| 32 |
+
`basic_ios` class.
|
| 33 |
+
|
| 34 |
+
[*Note 1*: The first argument provides an object of the
|
| 35 |
`istreambuf_iterator` class which is an iterator pointed to an input
|
| 36 |
+
stream. It bypasses istreams and uses streambufs
|
| 37 |
+
directly. — *end note*]
|
| 38 |
+
|
| 39 |
+
Class `locale` relies on this type as its interface to `istream`, so
|
| 40 |
+
that it does not need to depend directly on `istream`.
|
| 41 |
|
| 42 |
``` cpp
|
| 43 |
operator>>(short& val);
|
| 44 |
```
|
| 45 |
|
| 46 |
The conversion occurs as if performed by the following code fragment
|
| 47 |
(using the same notation as for the preceding code fragment):
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
+
using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
|
| 51 |
iostate err = ios_base::goodbit;
|
| 52 |
long lval;
|
| 53 |
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
|
| 54 |
if (lval < numeric_limits<short>::min()) {
|
| 55 |
err |= ios_base::failbit;
|
|
|
|
| 68 |
|
| 69 |
The conversion occurs as if performed by the following code fragment
|
| 70 |
(using the same notation as for the preceding code fragment):
|
| 71 |
|
| 72 |
``` cpp
|
| 73 |
+
using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
|
| 74 |
iostate err = ios_base::goodbit;
|
| 75 |
long lval;
|
| 76 |
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
|
| 77 |
if (lval < numeric_limits<int>::min()) {
|
| 78 |
err |= ios_base::failbit;
|