Standard C++ Library Reference ISO/IEC (VERSION3)

if ((exceptions() & badbit) != 0)
throw; }}
setstate(state);
Both groups of functions call setstate(eofbit) if they encounter end-of-file while
extracting elements.
An object of class basic_istream<Elem, Tr> stores:
a virtual public base object of class basic_ios<Elem, Tr>
an extraction count for the last unformatted input operation (called count in the code
above)
basic_istream::basic_istream
explicit basic_istream(basic_streambuf<Elem, Tr> *strbuf);
The constructor initializes the base class by calling init(strbuf). It also stores zero in the
extraction count.
basic_istream::gcount
streamsize gcount() const;
The member function returns the extraction count.
basic_istream::get
int_type get();
basic_istream& get(char_type& ch);
basic_istream& get(char_type *str, streamsize count);
basic_istream& get(char_type *str, streamsize count,
char_type delim);
basic_istream& get(basic_streambuf<Elem, Tr> *strbuf);
basic_istream& get(basic_streambuf<Elem, Tr> *strbuf,
char_type delim);
The first of these unformatted input functions extracts an element, if possible, as if by returning
rdbuf()->sbumpc(). Otherwise, it returns traits_type::eof(). If the function extracts
no element, it calls setstate(failbit).
The second function extracts the int_type element meta the same way. If meta compares
equal to traits_type::eof(), the function calls setstate(failbit). Otherwise, it
stores traits_type::to_char_type(meta) in ch. The function returns *this.
The third function returns get(str, count, widen('\n')).
The fourth function extracts up to count - 1 elements and stores them in the array beginning at