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

basic_istream& unget();
pos_type tellg();
basic_istream& seekg(pos_type pos);
basic_istream& seekg(off_type off,
ios_base::seek_dir way);
int sync();
};
The template class describes an object that controls extraction of elements and encoded objects
from a stream buffer with elements of type Elem, also known as char_type, whose character
traits are determined by the class Tr, also known as traits_type.
Most of the member functions that overload operator>> are formatted input functions. They
follow the pattern:
iostate state = goodbit;
const sentry ok(*this);
if (ok)
{try
{<extract elements and convert
accumulate flags in state
store a successful conversion> }
catch (...)
{try
{setstate(badbit); }
catch (...)
{}
if ((exceptions() & badbit) != 0)
throw; }}
setstate(state);
return (*this);
Many other member functions are unformatted input functions. They follow the pattern:
iostate state = goodbit;
count = 0; // the value returned by gcount
const sentry ok(*this, true);
if (ok)
{try
{<extract elements and deliver
count extracted elements in count
accumulate flags in state> }
catch (...)
{try
{setstate(badbit); }
catch (...)
{}