tmp/tmpxnag2489/{from.md → to.md}
RENAMED
|
@@ -2,11 +2,11 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT, class traits = char_traits<charT>>
|
| 6 |
class basic_istream<charT, traits>::sentry {
|
| 7 |
-
|
| 8 |
bool ok_; // exposition only
|
| 9 |
public:
|
| 10 |
explicit sentry(basic_istream<charT, traits>& is, bool noskipws = false);
|
| 11 |
~sentry();
|
| 12 |
explicit operator bool() const { return ok_; }
|
|
@@ -29,19 +29,23 @@ Otherwise, prepares for formatted or unformatted input. First, if
|
|
| 29 |
to synchronize the output sequence with any associated external C
|
| 30 |
stream. Except that this call can be suppressed if the put area of
|
| 31 |
`is.tie()` is empty. Further an implementation is allowed to defer the
|
| 32 |
call to `flush` until a call of `is.rdbuf()->underflow()` occurs. If no
|
| 33 |
such call occurs before the `sentry` object is destroyed, the call to
|
| 34 |
-
`flush` may be eliminated entirely.[^
|
| 35 |
`is.flags() & ios_base::skipws` is nonzero, the function extracts and
|
| 36 |
discards each character as long as the next available input character
|
| 37 |
`c` is a whitespace character. If `is.rdbuf()->sbumpc()` or
|
| 38 |
`is.rdbuf()->sgetc()` returns `traits::eof()`, the function calls
|
| 39 |
`setstate(failbit | eofbit)` (which may throw `ios_base::failure`).
|
| 40 |
|
| 41 |
*Remarks:* The constructor
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
uses the currently imbued locale in `is`, to determine whether the next
|
| 44 |
input character is whitespace or not.
|
| 45 |
|
| 46 |
To decide if the character `c` is a whitespace character, the
|
| 47 |
constructor performs as if it executes the following code fragment:
|
|
@@ -53,11 +57,11 @@ if (ctype.is(ctype.space,c)!=0)
|
|
| 53 |
```
|
| 54 |
|
| 55 |
If, after any preparation is completed, `is.good()` is `true`,
|
| 56 |
`ok_ != false` otherwise, `ok_ == false`. During preparation, the
|
| 57 |
constructor may call `setstate(failbit)` (which may throw
|
| 58 |
-
`ios_base::failure` ([[iostate.flags]]))[^
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
~sentry();
|
| 62 |
```
|
| 63 |
|
|
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT, class traits = char_traits<charT>>
|
| 6 |
class basic_istream<charT, traits>::sentry {
|
| 7 |
+
using traits_type = traits;
|
| 8 |
bool ok_; // exposition only
|
| 9 |
public:
|
| 10 |
explicit sentry(basic_istream<charT, traits>& is, bool noskipws = false);
|
| 11 |
~sentry();
|
| 12 |
explicit operator bool() const { return ok_; }
|
|
|
|
| 29 |
to synchronize the output sequence with any associated external C
|
| 30 |
stream. Except that this call can be suppressed if the put area of
|
| 31 |
`is.tie()` is empty. Further an implementation is allowed to defer the
|
| 32 |
call to `flush` until a call of `is.rdbuf()->underflow()` occurs. If no
|
| 33 |
such call occurs before the `sentry` object is destroyed, the call to
|
| 34 |
+
`flush` may be eliminated entirely.[^18] If `noskipws` is zero and
|
| 35 |
`is.flags() & ios_base::skipws` is nonzero, the function extracts and
|
| 36 |
discards each character as long as the next available input character
|
| 37 |
`c` is a whitespace character. If `is.rdbuf()->sbumpc()` or
|
| 38 |
`is.rdbuf()->sgetc()` returns `traits::eof()`, the function calls
|
| 39 |
`setstate(failbit | eofbit)` (which may throw `ios_base::failure`).
|
| 40 |
|
| 41 |
*Remarks:* The constructor
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
explicit sentry(basic_istream<charT, traits>& is, bool noskipws = false)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
uses the currently imbued locale in `is`, to determine whether the next
|
| 48 |
input character is whitespace or not.
|
| 49 |
|
| 50 |
To decide if the character `c` is a whitespace character, the
|
| 51 |
constructor performs as if it executes the following code fragment:
|
|
|
|
| 57 |
```
|
| 58 |
|
| 59 |
If, after any preparation is completed, `is.good()` is `true`,
|
| 60 |
`ok_ != false` otherwise, `ok_ == false`. During preparation, the
|
| 61 |
constructor may call `setstate(failbit)` (which may throw
|
| 62 |
+
`ios_base::failure` ([[iostate.flags]]))[^19]
|
| 63 |
|
| 64 |
``` cpp
|
| 65 |
~sentry();
|
| 66 |
```
|
| 67 |
|