7.5 KiB
[istream.extractors]
31 Input/output library [input.output]
31.7 Formatting and manipulators [iostream.format]
31.7.5 Input streams [input.streams]
31.7.5.3 Formatted input functions [istream.formatted]
31.7.5.3.3 basic_istream::operator>> [istream.extractors]
basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
Effects: None.
This extractor does not behave as a formatted input function (as described in [istream.formatted.reqmts]).
Returns: pf(*this).
basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
Effects: Callspf(*this).
This extractor does not behave as a formatted input function (as described in [istream.formatted.reqmts]).
Returns: *this.
basic_istream& operator>>(ios_base& (*pf)(ios_base&));
This extractor does not behave as a formatted input function (as described in [istream.formatted.reqmts]).
Returns: *this.
template<class charT, class traits, size_t N> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT (&s)[N]); template<class traits, size_t N> basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char (&s)[N]); template<class traits, size_t N> basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char (&s)[N]);
Effects: Behaves like a formatted input member (as described in [istream.formatted.reqmts]) of in.
After asentry object is constructed,operator>> extracts characters and stores them intos.
Ifwidth() is greater than zero, n ismin(size_t(width()), N).
Otherwise n is N.
n is the maximum number of characters stored.
Characters are extracted and stored until any of the following occurs:
n - 1 characters are stored;
end of file occurs on the input sequence;
letting ct be use_facet<ctype>(in.getloc()),ct.is(ct.space, c) is true.
operator>> then stores a null byte (charT()) in the next position, which may be the first position if no characters were extracted.
operator>> then callswidth(0).
If the function extracted no characters,ios_base::failbit is set in the input function's local error state before setstate is called.
Returns: in.
template<class charT, class traits> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT& c); template<class traits> basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char& c); template<class traits> basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char& c);
Effects: Behaves like a formatted input member (as described in [istream.formatted.reqmts]) of in.
A character is extracted from in, if one is available, and stored in c.
Otherwise,ios_base::failbit is set in the input function's local error state before setstate is called.
Returns: in.
basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
Effects: Behaves as an unformatted input function.
If sb is null, callssetstate(failbit), which may throwios_base::failure ([iostate.flags]).
After a sentry object is constructed, extracts characters from*this and inserts them in the output sequence controlled by sb.
Characters are extracted and inserted until any of the following occurs:
end-of-file occurs on the input sequence;
inserting in the output sequence fails (in which case the character to be inserted is not extracted);
an exception occurs (in which case the exception is caught).
If the function inserts no characters,ios_base::failbit is set in the input function's local error state before setstate is called.
Returns: *this.
See, for example, the function signaturews(basic_istream&) ([istream.manip]).
See, for example, the function signaturedec(ios_base&) ([basefield.manip]).