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

43
cppdraft/using/headers.md Normal file
View File

@@ -0,0 +1,43 @@
[using.headers]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#using.headers)
### 16.4.3 Using the library [[using]](using#headers)
#### 16.4.3.2 Headers [using.headers]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1686)
The entities in the C++ standard library are defined in headers,
whose contents are made available to a translation unit when it contains the appropriate#include preprocessing directive ([[cpp.include]](cpp.include "15.3Source file inclusion"))
or the appropriateimport declaration ([[module.import]](module.import "10.3Import declaration"))[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1698)
A translation unit may include library headers in any order ([[lex.separate]](lex.separate "5.1Separate translation"))[.](#2.sentence-1)
Each may be included more than once, with no effect different from
being included exactly once, except that the effect of including either[<cassert>](assertions.general#header:%3ccassert%3e "19.3.1General[assertions.general]") or [<assert.h>](support.c.headers.general#header:%3cassert.h%3e "17.15.1General[support.c.headers.general]") depends each time on the lexically current definition ofNDEBUG[.](#2.sentence-2)[149](#footnote-149 "This is the same as the C standard library.")
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1712)
A translation unit shall include a header only outside of anydeclaration or definition and,
in the case of a module unit,
only in its [*global-module-fragment*](module.global.frag#nt:global-module-fragment "10.4Global module fragment[module.global.frag]"), and
shall include the header or import the corresponding header unit lexically
before the first reference in that translation unit to any of the entities
declared in that header[.](#3.sentence-1)
No diagnostic is required[.](#3.sentence-2)
[149)](#footnote-149)[149)](#footnoteref-149)
This is the same as the C standard library[.](#footnote-149.sentence-1)

47
cppdraft/using/linkage.md Normal file
View File

@@ -0,0 +1,47 @@
[using.linkage]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#using.linkage)
### 16.4.3 Using the library [[using]](using#linkage)
#### 16.4.3.3 Linkage [using.linkage]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1724)
Entities in the C++ standard library have [external linkage](basic.link "6.7Program and linkage[basic.link]")[.](#1.sentence-1)
Unless otherwise specified, objects and functions have the defaultextern "C++" linkage ([[dcl.link]](dcl.link "9.12Linkage specifications"))[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1730)
Whether a name from the C standard library declared with
external linkage hasextern "C" orextern "C++" linkage is implementation-defined[.](#2.sentence-1)
It is recommended that an
implementation useextern "C++" linkage for this purpose[.](#2.sentence-2)[150](#footnote-150 "The only reliable way to declare an object or function signature from the C standard library is by including the header that declares it, notwithstanding the latitude granted in ISO/IEC 9899:2024, 7.1.4.")
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1751)
Objects and functions
defined in the library and required by a C++ program are included in
the program prior to program startup[.](#3.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1757)
See also[replacement functions](replacement.functions "16.4.5.6Replacement functions[replacement.functions]"),[runtime changes](handler.functions "16.4.5.7Handler functions[handler.functions]")[.](#4.sentence-1)
[150)](#footnote-150)[150)](#footnoteref-150)
The only reliable way to declare an object or
function signature from the C standard library is by including the header that
declares it, notwithstanding the latitude granted in ISO/IEC 9899:2024, 7.1.4[.](#footnote-150.sentence-1)

View File

@@ -0,0 +1,20 @@
[using.overview]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#using.overview)
### 16.4.3 Using the library [[using]](using#overview)
#### 16.4.3.1 Overview [using.overview]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L1678)
Subclause [[using]](using "16.4.3Using the library") describes how a C++ program gains access to the facilities of the
C++ standard library[.](#1.sentence-1)
[[using.headers]](using.headers "16.4.3.2Headers") describes effects during translation
phase 4, while [[using.linkage]](using.linkage "16.4.3.3Linkage") describes effects during [phase
8](lex.phases "5.2Phases of translation[lex.phases]")[.](#1.sentence-2)