tmp/tmpoz4zpdio/{from.md → to.md}
RENAMED
|
@@ -3,11 +3,11 @@
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT,class traits = char_traits<charT> >
|
| 6 |
class basic_istream<charT,traits>::sentry {
|
| 7 |
typedef traits traits_type;
|
| 8 |
-
bool ok_; // exposition
|
| 9 |
public:
|
| 10 |
explicit sentry(basic_istream<charT,traits>& is, bool noskipws = false);
|
| 11 |
~sentry();
|
| 12 |
explicit operator bool() const { return ok_; }
|
| 13 |
sentry(const sentry&) = delete;
|
|
@@ -21,19 +21,19 @@ exception safe prefix and suffix operations.
|
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
explicit sentry(basic_istream<charT,traits>& is, bool noskipws = false);
|
| 24 |
```
|
| 25 |
|
| 26 |
-
*Effects:* If `is.good()` is `false`, calls is.setstate(failbit).
|
| 27 |
Otherwise, prepares for formatted or unformatted input. First, if
|
| 28 |
`is.tie()` is not a null pointer, the function calls `is.tie()->flush()`
|
| 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`).
|
|
@@ -53,11 +53,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 |
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template <class charT,class traits = char_traits<charT> >
|
| 6 |
class basic_istream<charT,traits>::sentry {
|
| 7 |
typedef traits traits_type;
|
| 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_; }
|
| 13 |
sentry(const sentry&) = delete;
|
|
|
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
explicit sentry(basic_istream<charT,traits>& is, bool noskipws = false);
|
| 24 |
```
|
| 25 |
|
| 26 |
+
*Effects:* If `is.good()` is `false`, calls `is.setstate(failbit)`.
|
| 27 |
Otherwise, prepares for formatted or unformatted input. First, if
|
| 28 |
`is.tie()` is not a null pointer, the function calls `is.tie()->flush()`
|
| 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.[^17] 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`).
|
|
|
|
| 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]]))[^18]
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
~sentry();
|
| 62 |
```
|
| 63 |
|