From Jason Turner

[istream.extractors]

Diff to HTML by rtfpessoa

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