single character (1) | template<class charT, class traits>basic_istream<charT,traits>& operator>> (basic_istream<charT,traits>& is, charT& c);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, signed char& c);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, unsigned char& c); |
---|---|
character sequence (2) | template<class charT, class traits>basic_istream<charT,traits>& operator>> (basic_istream<charT,traits>& is, charT* s);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, signed char* s);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, unsigned char* s); |
single character (1) | template<class charT, class traits>basic_istream<charT,traits>& operator>> (basic_istream<charT,traits>& is, charT& c);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, signed char& c);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, unsigned char& c); |
---|---|
character sequence (2) | template<class charT, class traits>basic_istream<charT,traits>& operator>> (basic_istream<charT,traits>& is, charT* s);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, signed char* s);template<class traits>basic_istream<char,traits>& operator>> (basic_istream<char,traits>& is, unsigned char* s); |
rvalue extraction (3) | template<class charT, class traits, class T>basic_istream<charT,traits>& operator>> (basic_istream<charT,traits>&& is, T& val); |
>>
) applied to an input stream is known as extraction operator, and performs formatted input:(width()-1)
characters have been extracted (if width is not zero).charT()
) is automatically appended to the written sequence.is>>val
.false
: this may flush its tied stream and/or discard leading whitespaces (see basic_istream::sentry). Then (if good), it extracts characters from is's associated stream buffer object (as if calling its member functions sbumpc or sgetc), and finally destroys the sentry object before returning.flag | error |
---|---|
eofbit | The function stopped extracting characters because the input sequence controlled by is has no more characters available (end-of-file reached). |
failbit | Either no characters were extracted, or these could not be interpreted as a valid value of the appropriate type. |
badbit | Error on stream (such as when this function catches an exception thrown by an internal operation). When set, the integrity of the stream may have been affected. |
|
|