tmp/tmpf1b4b231/{from.md → to.md}
RENAMED
|
@@ -1,117 +0,0 @@
|
|
| 1 |
-
##### `basic_istream::operator>>` <a id="istream::extractors">[[istream::extractors]]</a>
|
| 2 |
-
|
| 3 |
-
``` cpp
|
| 4 |
-
basic_istream<charT,traits>& operator>>
|
| 5 |
-
(basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&));
|
| 6 |
-
```
|
| 7 |
-
|
| 8 |
-
*Effects:* None. This extractor does not behave as a formatted input
|
| 9 |
-
function (as described in [[istream.formatted.reqmts]].)
|
| 10 |
-
|
| 11 |
-
*Returns:* `pf(*this)`.[^20]
|
| 12 |
-
|
| 13 |
-
``` cpp
|
| 14 |
-
basic_istream<charT,traits>& operator>>
|
| 15 |
-
(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&));
|
| 16 |
-
```
|
| 17 |
-
|
| 18 |
-
*Effects:* Calls `pf(*this)`. This extractor does not behave as a
|
| 19 |
-
formatted input function (as described
|
| 20 |
-
in [[istream.formatted.reqmts]]).
|
| 21 |
-
|
| 22 |
-
*Returns:* `*this`.
|
| 23 |
-
|
| 24 |
-
``` cpp
|
| 25 |
-
basic_istream<charT,traits>& operator>>
|
| 26 |
-
(ios_base& (*pf)(ios_base&));
|
| 27 |
-
```
|
| 28 |
-
|
| 29 |
-
*Effects:* Calls `pf(*this)`.[^21] This extractor does not behave as a
|
| 30 |
-
formatted input function (as described
|
| 31 |
-
in [[istream.formatted.reqmts]]).
|
| 32 |
-
|
| 33 |
-
*Returns:* `*this`.
|
| 34 |
-
|
| 35 |
-
``` cpp
|
| 36 |
-
template<class charT, class traits>
|
| 37 |
-
basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>& in,
|
| 38 |
-
charT* s);
|
| 39 |
-
template<class traits>
|
| 40 |
-
basic_istream<char,traits>& operator>>(basic_istream<char,traits>& in,
|
| 41 |
-
unsigned char* s);
|
| 42 |
-
template<class traits>
|
| 43 |
-
basic_istream<char,traits>& operator>>(basic_istream<char,traits>& in,
|
| 44 |
-
signed char* s);
|
| 45 |
-
```
|
| 46 |
-
|
| 47 |
-
*Effects:* Behaves like a formatted input member (as described
|
| 48 |
-
in [[istream.formatted.reqmts]]) of `in`. After a `sentry` object is
|
| 49 |
-
constructed, `operator>>` extracts characters and stores them into
|
| 50 |
-
successive locations of an array whose first element is designated by
|
| 51 |
-
`s`. If `width()` is greater than zero, `n` is `width()`. Otherwise `n`
|
| 52 |
-
is the number of elements of the largest array of `char_type` that can
|
| 53 |
-
store a terminating `charT()`. `n` is the maximum number of characters
|
| 54 |
-
stored.
|
| 55 |
-
|
| 56 |
-
Characters are extracted and stored until any of the following occurs:
|
| 57 |
-
|
| 58 |
-
- `n-1` characters are stored;
|
| 59 |
-
- end of file occurs on the input sequence;
|
| 60 |
-
- `ct.is(ct.space,c)` is `true` for the next available input character
|
| 61 |
-
`c`, where `ct` is `use_facet<ctype<charT> >(in.getloc())`.
|
| 62 |
-
|
| 63 |
-
`operator>>` then stores a null byte (`charT()`) in the next position,
|
| 64 |
-
which may be the first position if no characters were extracted.
|
| 65 |
-
`operator>>` then calls `width(0)`.
|
| 66 |
-
|
| 67 |
-
If the function extracted no characters, it calls `setstate(failbit)`,
|
| 68 |
-
which may throw `ios_base::failure` ([[iostate.flags]]).
|
| 69 |
-
|
| 70 |
-
*Returns:* `in`.
|
| 71 |
-
|
| 72 |
-
``` cpp
|
| 73 |
-
template<class charT, class traits>
|
| 74 |
-
basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>& in,
|
| 75 |
-
charT& c);
|
| 76 |
-
template<class traits>
|
| 77 |
-
basic_istream<char,traits>& operator>>(basic_istream<char,traits>& in,
|
| 78 |
-
unsigned char& c);
|
| 79 |
-
template<class traits>
|
| 80 |
-
basic_istream<char,traits>& operator>>(basic_istream<char,traits>& in,
|
| 81 |
-
signed char& c);
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
*Effects:* Behaves like a formatted input member (as described
|
| 85 |
-
in [[istream.formatted.reqmts]]) of `in`. After a `sentry` object is
|
| 86 |
-
constructed a character is extracted from `in`, if one is available, and
|
| 87 |
-
stored in `c`. Otherwise, the function calls `in.setstate(failbit)`.
|
| 88 |
-
|
| 89 |
-
*Returns:* `in`.
|
| 90 |
-
|
| 91 |
-
``` cpp
|
| 92 |
-
basic_istream<charT,traits>& operator>>
|
| 93 |
-
(basic_streambuf<charT,traits>* sb);
|
| 94 |
-
```
|
| 95 |
-
|
| 96 |
-
*Effects:* Behaves as an unformatted input function (as described
|
| 97 |
-
in [[istream.unformatted]], paragraph 1). If `sb` is null, calls
|
| 98 |
-
`setstate(failbit)`, which may throw
|
| 99 |
-
`ios_base::failure` ([[iostate.flags]]). After a sentry object is
|
| 100 |
-
constructed, extracts characters from `*this` and inserts them in the
|
| 101 |
-
output sequence controlled by `sb`. Characters are extracted and
|
| 102 |
-
inserted until any of the following occurs:
|
| 103 |
-
|
| 104 |
-
- end-of-file occurs on the input sequence;
|
| 105 |
-
- inserting in the output sequence fails (in which case the character to
|
| 106 |
-
be inserted is not extracted);
|
| 107 |
-
- an exception occurs (in which case the exception is caught).
|
| 108 |
-
|
| 109 |
-
If the function inserts no characters, it calls `setstate(failbit)`,
|
| 110 |
-
which may throw `ios_base::failure` ([[iostate.flags]]). If it inserted
|
| 111 |
-
no characters because it caught an exception thrown while extracting
|
| 112 |
-
characters from `*this` and `failbit` is on in
|
| 113 |
-
`exceptions()` ([[iostate.flags]]), then the caught exception is
|
| 114 |
-
rethrown.
|
| 115 |
-
|
| 116 |
-
*Returns:* `*this`.
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|