17 Library introduction [library]

17.1 General [library.general]

This Clause describes the contents of the C++ standard library, how a well-formed C++ program makes use of the library, and how a conforming implementation may provide the entities in the library.

The following subclauses describe the definitions ([definitions]), method of description ([description]), and organization ([organization]) of the library. Clause [requirements], Clauses [language.support] through [thread], and Annex [depr] specify the contents of the library, as well as library requirements and constraints on both well-formed C++ programs and conforming implementations.

Detailed specifications for each of the components in the library are in Clauses [language.support][thread], as shown in Table [tab:library.categories].

Table 13 — Library categories
Clause Category
[language.support] Language support library
[diagnostics] Diagnostics library
[utilities] General utilities library
[strings] Strings library
[localization] Localization library
[containers] Containers library
[iterators] Iterators library
[algorithms] Algorithms library
[numerics] Numerics library
[input.output] Input/output library
[re] Regular expressions library
[atomics] Atomic operations library
[thread] Thread support library

The language support library (Clause [language.support]) provides components that are required by certain parts of the C++ language, such as memory allocation ([expr.new], [expr.delete]) and exception processing (Clause [except]).

The diagnostics library (Clause [diagnostics]) provides a consistent framework for reporting errors in a C++ program, including predefined exception classes.

The general utilities library (Clause [utilities]) includes components used by other library elements, such as a predefined storage allocator for dynamic storage management ([basic.stc.dynamic]), and components used as infrastructure in C++ programs, such as a tuples, function wrappers, and time facilities.

The strings library (Clause [strings]) provides support for manipulating text represented as sequences of type char, sequences of type char16_t, sequences of type char32_t, sequences of type wchar_t, and sequences of any other character-like type.

The localization library (Clause [localization]) provides extended internationalization support for text processing.

The containers (Clause [containers]), iterators (Clause [iterators]), and algorithms (Clause [algorithms]) libraries provide a C++ program with access to a subset of the most widely used algorithms and data structures.

The numerics library (Clause [numerics]) provides numeric algorithms and complex number components that extend support for numeric processing. The valarray component provides support for n-at-a-time processing, potentially implemented as parallel operations on platforms that support such processing. The random number component provides facilities for generating pseudo-random numbers.

The input/output library (Clause [input.output]) provides the iostream components that are the primary mechanism for C++ program input and output. They can be used with other elements of the library, particularly strings, locales, and iterators.

The regular expressions library (Clause [re]) provides regular expression matching and searching.

The atomic operations library (Clause [atomics]) allows more fine-grained concurrent access to shared data than is possible with locks.

The thread support library (Clause [thread]) provides components to create and manage threads, including mutual exclusion and interthread communication.