This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

183
cppdraft/library/general.md Normal file
View File

@@ -0,0 +1,183 @@
[library.general]
# 16 Library introduction [[library]](./#library)
## 16.1 General [library.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L6)
This Clause describes the contents of the[*C++ standard library*](#def:library,C++_standard "16.1General[library.general]"),
how a well-formed C++ program makes use of the library, and
how a conforming implementation may provide the entities in the library[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L12)
The following subclauses describe the method of
description ([[description]](description "16.3Method of description")) and organization ([[organization]](organization "16.4.2Library contents and organization")) of the
library[.](#2.sentence-1)
[[requirements]](requirements "16.4Library-wide requirements"), [[support]](support "17Language support library") through [[exec]](exec "33Execution control library"), and [[depr]](depr "Annex D(normative)Compatibility features") specify the contents of the
library, as well as library requirements and constraints on both well-formed
C++ programs and conforming implementations[.](#2.sentence-2)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L20)
Detailed specifications for each of the components in the library are in[[support]](support "17Language support library")–[[exec]](exec "33Execution control library"), as shown in
Table [23](#tab:library.categories "Table 23: Library categories")[.](#3.sentence-1)
Table [23](#tab:library.categories) — Library categories [[tab:library.categories]](./tab:library.categories)
| [🔗](#tab:library.categories-row-1)<br>**Clause** | **Category** |
| --- | --- |
| [🔗](#tab:library.categories-row-2)<br>[[support]](support "17Language support library") | Language support library |
| [🔗](#tab:library.categories-row-3)<br>[[concepts]](concepts "18Concepts library") | Concepts library |
| [🔗](#tab:library.categories-row-4)<br>[[diagnostics]](diagnostics "19Diagnostics library") | Diagnostics library |
| [🔗](#tab:library.categories-row-5)<br>[[mem]](mem "20Memory management library") | Memory management library |
| [🔗](#tab:library.categories-row-6)<br>[[meta]](meta "21Metaprogramming library") | Metaprogramming library |
| [🔗](#tab:library.categories-row-7)<br>[[utilities]](utilities "22General utilities library") | General utilities library |
| [🔗](#tab:library.categories-row-8)<br>[[containers]](containers "23Containers library") | Containers library |
| [🔗](#tab:library.categories-row-9)<br>[[iterators]](iterators "24Iterators library") | Iterators library |
| [🔗](#tab:library.categories-row-10)<br>[[ranges]](ranges "25Ranges library") | Ranges library |
| [🔗](#tab:library.categories-row-11)<br>[[algorithms]](algorithms "26Algorithms library") | Algorithms library |
| [🔗](#tab:library.categories-row-12)<br>[[strings]](strings "27Strings library") | Strings library |
| [🔗](#tab:library.categories-row-13)<br>[[text]](text "28Text processing library") | Text processing library |
| [🔗](#tab:library.categories-row-14)<br>[[numerics]](numerics "29Numerics library") | Numerics library |
| [🔗](#tab:library.categories-row-15)<br>[[time]](time "30Time library") | Time library |
| [🔗](#tab:library.categories-row-16)<br>[[input.output]](input.output "31Input/output library") | Input/output library |
| [🔗](#tab:library.categories-row-17)<br>[[thread]](thread "32Concurrency support library") | Concurrency support library |
| [🔗](#tab:library.categories-row-18)<br>[[exec]](exec "33Execution control library") | Execution control library |
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L48)
The operating system interface described in ISO/IEC/IEEE 9945:2009 is
hereinafter called [*POSIX*](#def:POSIX "16.1General[library.general]")[.](#4.sentence-1)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L52)
The language support library ([[support]](support "17Language support library")) provides components that are
required by certain parts of the C++ language,
such as memory allocation ([[expr.new]](expr.new "7.6.2.8New"), [[expr.delete]](expr.delete "7.6.2.9Delete")) and
exception processing ([[except]](except "14Exception handling"))[.](#5.sentence-1)
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L58)
The concepts library ([[concepts]](concepts "18Concepts library")) describes library components that C++
programs may use to perform compile-time validation of template arguments and
perform function dispatch based on properties of types[.](#6.sentence-1)
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L63)
The diagnostics library ([[diagnostics]](diagnostics "19Diagnostics library")) provides a consistent framework for
reporting errors in a C++ program, including predefined exception classes[.](#7.sentence-1)
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L67)
The memory management library ([[mem]](mem "20Memory management library")) provides components for
memory management, including smart pointers and scoped allocators[.](#8.sentence-1)
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L71)
The metaprogramming library ([[meta]](meta "21Metaprogramming library")) describes facilities
for use in templates and during constant evaluation,
including type traits, integer sequences, and rational arithmetic[.](#9.sentence-1)
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L76)
The general utilities library ([[utilities]](utilities "22General utilities library")) includes components used
by other library elements, such as a predefined storage allocator for dynamic
storage management ([[basic.stc.dynamic]](basic.stc.dynamic "6.8.6.5Dynamic storage duration")), and components used
as infrastructure
in C++ programs,
such as tuples and function wrappers[.](#10.sentence-1)
[11](#11)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L84)
The containers ([[containers]](containers "23Containers library")), iterators ([[iterators]](iterators "24Iterators library")), ranges ([[ranges]](ranges "25Ranges library")),
and algorithms ([[algorithms]](algorithms "26Algorithms library")) libraries provide a C++ program with access
to a subset of the most widely used algorithms and data structures[.](#11.sentence-1)
[12](#12)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L89)
The strings library ([[strings]](strings "27Strings library")) provides support
for manipulating sequences of type char,
sequences of type char8_t,
sequences of type char16_t,
sequences of type char32_t,
sequences of type wchar_t,
and sequences of any other character-like type[.](#12.sentence-1)
[13](#13)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L98)
The text processing library ([[text]](text "28Text processing library")) provides support for text processing,
including formatting, internationalization support and
regular expression matching and searching[.](#13.sentence-1)
[14](#14)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L103)
The [numerics library](numerics "29Numerics library[numerics]") provides
numeric algorithms and complex number components that extend support for numeric processing[.](#14.sentence-1)
Thevalarray component provides support for*n*-at-a-time
processing,
potentially implemented as parallel operations on platforms that support such processing[.](#14.sentence-2)
The random number component provides facilities for generating pseudo-random numbers[.](#14.sentence-3)
[15](#15)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L114)
The time library ([[time]](time "30Time library")) provides
generally useful time utilities[.](#15.sentence-1)
[16](#16)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L118)
The input/output library ([[input.output]](input.output "31Input/output library")) provides theiostream components that are the primary mechanism for C++ program input and output[.](#16.sentence-1)
They can be used with other elements of the library, particularly
strings, locales, and iterators[.](#16.sentence-2)
[17](#17)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L125)
The concurrency support library ([[thread]](thread "32Concurrency support library")) provides components to create
and manage threads,
including atomic operations, mutual exclusion, and interthread communication[.](#17.sentence-1)
[18](#18)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L130)
The execution control library ([[exec]](exec "33Execution control library")) provides components
supporting execution of function objects[.](#18.sentence-1)