91 lines
3.9 KiB
Markdown
91 lines
3.9 KiB
Markdown
[std.modules]
|
||
|
||
# 16 Library introduction [[library]](./#library)
|
||
|
||
## 16.4 Library-wide requirements [[requirements]](requirements#std.modules)
|
||
|
||
### 16.4.2 Library contents and organization [[organization]](organization#std.modules)
|
||
|
||
#### 16.4.2.4 Modules [std.modules]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1513)
|
||
|
||
The C++ standard library provides
|
||
the following [*C++ library modules*](#def:C++_library_modules "16.4.2.4 Modules [std.modules]")[.](#1.sentence-1)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1517)
|
||
|
||
The named module std exports declarations in namespace std that are provided by the importable C++ library headers
|
||
(Table [24](headers#tab:headers.cpp "Table 24: C++ library headers") or the subset provided by a freestanding implementation)
|
||
and the C++ headers for C library facilities (Table [25](headers#tab:headers.cpp.c "Table 25: C++ headers for C library facilities"))[.](#2.sentence-1)
|
||
|
||
It additionally exports declarations in the global namespace
|
||
for the storage allocation and deallocation functions
|
||
that are provided by [<new>](support.dynamic.general#header:%3cnew%3e "17.6.1 General [support.dynamic.general]")[.](#2.sentence-2)
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1526)
|
||
|
||
The named module std.compat exports the same declarations as
|
||
the named module std, and
|
||
additionally exports
|
||
|
||
- [(3.1)](#3.1)
|
||
|
||
declarations in the global namespace
|
||
corresponding to the declarations in namespace std that are provided by
|
||
the C++ headers for C library facilities (Table [25](headers#tab:headers.cpp.c "Table 25: C++ headers for C library facilities")),
|
||
except the explicitly excluded declarations
|
||
described in [[support.c.headers.other]](support.c.headers.other "17.15.7 Other C headers") and
|
||
|
||
- [(3.2)](#3.2)
|
||
|
||
declarations provided by
|
||
the headers [<stdbit.h>](stdbit.h.syn#header:%3cstdbit.h%3e "22.12 Header <stdbit.h> synopsis [stdbit.h.syn]") and [<stdckdint.h>](stdckdint.h.syn#header:%3cstdckdint.h%3e "29.11.1 Header <stdckdint.h> synopsis [stdckdint.h.syn]")[.](#3.sentence-1)
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1543)
|
||
|
||
It is unspecified to which module a declaration in the standard library
|
||
is attached[.](#4.sentence-1)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
Conforming implementations ensure that mixing#include and import does not result in
|
||
conflicting attachments ([[basic.link]](basic.link "6.7 Program and linkage"))[.](#4.sentence-2)
|
||
|
||
â *end note*]
|
||
|
||
*Recommended practice*: Implementations should ensure such attachments do not preclude
|
||
further evolution or decomposition of the standard library modules[.](#4.sentence-3)
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1555)
|
||
|
||
A declaration in the standard library denotes the same entity regardless of
|
||
whether it was made reachable through
|
||
including a header,
|
||
importing a header unit, or
|
||
importing a C++ library module[.](#5.sentence-1)
|
||
|
||
[6](#6)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1562)
|
||
|
||
*Recommended practice*: Implementations should avoid exporting any other declarations
|
||
from the C++ library modules[.](#6.sentence-1)
|
||
|
||
[*Note [2](#note-2)*:
|
||
|
||
Like all named modules, the C++ library modules
|
||
do not make macros visible ([[module.import]](module.import "10.3 Import declaration")), such asassert ([[cassert.syn]](cassert.syn "19.3.2 Header <cassert> synopsis")),errno ([[cerrno.syn]](cerrno.syn "19.4.2 Header <cerrno> synopsis")),offsetof ([[cstddef.syn]](cstddef.syn "17.2.1 Header <cstddef> synopsis")), andva_arg ([[cstdarg.syn]](cstdarg.syn "17.14.2 Header <cstdarg> synopsis"))[.](#6.sentence-2)
|
||
|
||
â *end note*]
|