[iostream.forward] (original) (raw)

29.3.1 Header synopsis [iosfwd.syn]

Default template arguments are described as appearing both inand in the synopsis of other headers but it is well-formed to include bothand one or more of the other headers.287

29.3.2 Overview [iostream.forward.overview]

The class template specializationbasic_­ios<charT, traits>serves as a virtual base class for the class templatesbasic_­istream,basic_­ostream, and class templates derived from them.

basic_­iostreamis a class template derived from bothbasic_­istream<charT, traits>andbasic_­ostream<charT, traits>.

The class template specializationbasic_­streambuf<charT, traits>serves as a base class for class templatesbasic_­stringbuf,basic_­filebuf, andbasic_­syncbuf.

The class template specializationbasic_­istream<charT, traits>serves as a base class for class templatesbasic_­istringstreamandbasic_­ifstream.

The class template specializationbasic_­ostream<charT, traits>serves as a base class for class templatesbasic_­ostringstream,basic_­ofstream, andbasic_­osyncstream.

The class template specializationbasic_­iostream<charT, traits>serves as a base class for class templatesbasic_­stringstreamandbasic_­fstream.

[Note 1:

For each of the class templates above, the program is ill-formed iftraits​::​char_­typeis not the same type ascharT ([char.traits]).

— _end note_]

Other typedef-names define instances of class templates specialized forcharorwchar_­ttypes.

Specializations of the class templatefposare used for specifying file position information.

[Example 1:

The typesstreamposandwstreamposare used for positioning streams specialized oncharandwchar_­trespectively.

— _end example_]

[Note 2:

This synopsis suggests a circularity betweenstreamposandchar_­traits<char>.

An implementation can avoid this circularity by substituting equivalent types.

— _end note_]