O'Reilly logo

C++ In a Nutshell by Ray Lischner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

<iosfwd>

The <iosfwd> header provides forward declarations of the various I/O-related classes and templates. The forward declarations are incomplete type declarations. (Read about complete and incomplete types in Chapter 6.) By using <iosfwd> you can sometimes avoid including the complete definitions of the I/O classes, and thereby save some compilation time.

It is always safe to include <iosfwd> and any of the other I/O headers, even if they both declare the same type.

Because <iosfwd> does not provide any complete type declarations, this section contains only Table 13-18, which lists each type name with a reference to the header (if any) that is required for the complete type.

Table 13-18. Forward type declarations in <iosfwd>

Type declaration

Header

template<typename T> class allocator

<memory>

template<typename charT, typename traits=char_traits<charT> > class basic_filebuf

<fstream>

template<typename charT, typename traits=char_traits<charT> > class basic_fstream

<fstream>

template<typename charT, typename traits=char_traits<charT> > class basic_ifstream

<fstream>

template<typename charT, typename traits=char_traits<charT> > class basic_ios

<ios>

template<typename charT, typename traits=char_traits<charT> > class basic_iostream

<istream>

template<typename charT, typename traits=char_traits<charT> > class basic_istream

<istream>

template<typename charT, typename traits=char_traits<charT>, typename Alloc = allocator<charT> > class basic_istringstream ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required