class template
<ios> <iostream>


template <class charT, class traits = char_traits<charT> >
  class basic_ios;
Base class for streams (type-dependent components)

Template class to instantiate the base classes for all stream classes.

Both this class template and its parent class, ios_base, define the components of streams that do not depend on whether the stream is an input or an output stream. ios_base describes the members that are independent of the template parameters, while this one describes the members that are dependent on the template parameters.

The class template adds to the information kept by its inherited ios_base component, the following:

fieldmember functionsdescription
Formattingfill characterfillCharacter to pad a formatted field up to the field width (width).
Stateerror staterdstate
The current error state of the stream.
Individual values may be obtained by calling good, eof, fail and bad.
See member type iostate.
exception maskexceptionsThe state flags for which a failure exception is thrown.
See member type iostate.
Othertied streamtiePointer to output stream that is flushed before each i/o operation on this stream.
stream bufferrdbufPointer to the associated basic_streambuf object, which is charge of all input/output operations.

Template parameters

Character type.
This shall be a non-array POD type.
Aliased as member type basic_ios::char_type.
Character traits class that defines essential properties of the characters used by stream objects (see char_traits).
traits::char_type shall be the same as charT.
Aliased as member type basic_ios::traits_type.

Template instantiations

These instantiations are declared in <iosfwd>, which is included by reference in <ios> and <iostream>.

Member types

member typedefinitionnotes
char_typeThe first template parameter (charT)
traits_typeThe second template parameter (traits)defaults to: char_traits<charT>
pos_typetraits_type::pos_typegenerally, the same as streampos
off_typetraits_type::off_typegenerally, the same as streamoff
Along with the member types inherited from ios_base:

Public member functions

State flag functions:



Protected member functions

Public member functions inherited from ios_base