File: headers.yo

package info (click to toggle)
c%2B%2B-annotations 8.2.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,804 kB
  • ctags: 2,845
  • sloc: cpp: 15,418; makefile: 2,473; ansic: 165; perl: 90; sh: 29
file content (37 lines) | stat: -rw-r--r-- 1,879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    Several iostream related i(header file)s are available. Depending on
the situation at hand, the following header files should be used:
    itemization(
    iti(iosfwd): sources should include this header file if only a declaration
of the stream classes is required. For example, if a function defines a
reference parameter to an tt(ostream) then the compiler doesn not need to know
exactly what an tt(ostream) is. When declaring such a function
the tt(ostream) class merely needs to be be declared. One cannot use
        verb(
    class std::ostream; // erroneous declaration

    void someFunction(std::ostream &str);
        )
    but, instead, one should use:
        verb(
    #include <iosfwd>   // correctly declares class ostream

    void someFunction(std::ostream &str);
        )
    ithi(streambuf): sources should include this header file when using
tt(streambuf) or ti(filebuf) classes. See sections ref(STREAMBUF) and
ref(FILEBUF).
    ithi(istream): sources should include this preprocessor directive when
using the class tt(istream) or when using classes that do both input and
output.  See section ref(ISTREAM).
    ithi(ostream): sources should include this header file when using the class
ti(ostream) class or when using classes that do both input and output.  See
section ref(OSTREAM).
    ithi(iostream): sources should include this header file when using the
global stream objects (like ti(cin) and ti(cout)).
    ithi(fstream): sources should include this header file when using the file
stream classes.  See sections ref(OFSTREAM), ref(IFSTREAM), and ref(FSTREAM).
    ithi(sstream): sources should include this header file when using the
string stream classes. See sections ref(OSTRINGSTREAM) and ref(ISTRINGSTREAM).
    ithi(iomanip): sources should include this header file when using
parameterized manipulators. See section ref(IOFORMAT).
    )