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

Next
C++ Library Overview
Using C++ Library Headers · C++ Library Conventions · Iostreams Conventions ·
Program Startup and Termination
All C++ library entities are declared or defined in one or more standard headers. To make use of
a library entity in a program, write an include directive that names the relevant standard header.
The Standard C++ library consists of 51 required headers. This implementation also includes
three additional headers, <hash_map>, <hash_set>, and <slist>, not required by the
C++ Standard, for a total of 54 headers. These 54 C++ library headers (along with the
additional 18 Standard C headers) constitute a hosted implementation of the C++ library:
<algorithm>, <bitset>, <cassert>, <cctype>, <cerrno>, <cfloat>,
<ciso646>, <climits>, <clocale>, <cmath>, <complex>, <csetjmp>,
<csignal>, <cstdarg>, <cstddef>, <cstdio>, <cstdlib>, <cstring>,
<ctime>, <cwchar>, <cwctype>, <deque>, <exception>, <fstream>,
<functional>, <hash_map>, <hash_set>, <iomanip>, <ios>, <iosfwd>,
<iostream>, <istream>, <iterator>, <limits>, <list>, <locale>, <map>,
<memory>, <new>, <numeric>, <ostream>, <queue>, <set>, <slist>,
<sstream>, <stack>, <stdexcept>, <streambuf>, <string>, <strstream>,
<typeinfo>, <utility>, <valarray>, and <vector>.
A freestanding implementation of the C++ library provides only a subset of these headers:
<cstddef>, <cstdlib> (declaring at least the functions abort, atexit, and exit),
<exception>, <limits>, <new>, <typeinfo>, and <cstdarg>.
The C++ library headers have two broader subdivisions, iostreams headers and STL headers.
Using C++ Library Headers
You include the contents of a standard header by naming it in an include directive, as in:
#include <iostream> /* include I/O facilities */
You can include the standard headers in any order, a standard header more than once, or two or
more standard headers that define the same macro or the same type. Do not include a standard
header within a declaration. Do not define macros that have the same names as keywords before
you include a standard header.
A C++ library header includes any other C++ library headers it needs to define needed types.
(Always include explicitly any C++ library headers needed in a translation unit, however, lest