From Jason Turner

[organization]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjnm0g_y1/{from.md → to.md} +60 -93
tmp/tmpjnm0g_y1/{from.md → to.md} RENAMED
@@ -1,100 +1,82 @@
1
  ### Library contents and organization <a id="organization">[[organization]]</a>
2
 
3
- [[contents]] describes the entities and macros defined in the
4
- C++standard library. [[headers]] lists the standard library headers and
5
  some constraints on those headers. [[compliance]] lists requirements for
6
  a freestanding implementation of the C++ standard library.
7
 
8
  #### Library contents <a id="contents">[[contents]]</a>
9
 
10
- The C++standard library provides definitions for the entities and macros
11
- described in the synopses of the C++standard library headers (
12
- [[headers]]).
13
 
14
  All library entities except `operator new` and `operator delete` are
15
  defined within the namespace `std` or namespaces nested within namespace
16
  `std`.[^12] It is unspecified whether names declared in a specific
17
  namespace are declared directly in that namespace or in an inline
18
  namespace inside that namespace.[^13]
19
 
20
  Whenever a name `x` defined in the standard library is mentioned, the
21
  name `x` is assumed to be fully qualified as `::std::x`, unless
22
- explicitly described otherwise. For example, if the *Effects:* section
23
  for library function `F` is described as calling library function `G`,
24
  the function `::std::G` is meant.
25
 
26
  #### Headers <a id="headers">[[headers]]</a>
27
 
28
  Each element of the C++ standard library is declared or defined (as
29
  appropriate) in a *header*.[^14]
30
 
31
  The C++ standard library provides the *C++ library headers*, shown in
32
- Table  [[tab:cpp.library.headers]].
33
-
34
- **Table: C++library headers** <a id="tab:cpp.library.headers">[tab:cpp.library.headers]</a>
35
-
36
- | | | | |
37
- | ---------------------- | -------------------- | -------------------- | ----------------- |
38
- | `<algorithm>` | `<future>` | `<numeric>` | `<strstream>` |
39
- | `<any>` | `<initializer_list>` | `<optional>` | `<system_error>` |
40
- | `<array>` | `<iomanip>` | `<ostream>` | `<thread>` |
41
- | `<atomic>` | `<ios>` | `<queue>` | `<tuple>` |
42
- | `<bitset>` | `<iosfwd>` | `<random>` | `<type_traits>` |
43
- | `<chrono>` | `<iostream>` | `<ratio>` | `<typeindex>` |
44
- | `<codecvt>` | `<istream>` | `<regex>` | `<typeinfo>` |
45
- | `<complex>` | `<iterator>` | `<scoped_allocator>` | `<unordered_map>` |
46
- | `<condition_variable>` | `<limits>` | `<set>` | `<unordered_set>` |
47
- | `<deque>` | `<list>` | `<shared_mutex>` | `<utility>` |
48
- | `<exception>` | `<locale>` | `<sstream>` | `<valarray>` |
49
- | `<execution>` | `<map>` | `<stack>` | `<variant>` |
50
- | `<filesystem>` | `<memory>` | `<stdexcept>` | `<vector>` |
51
- | `<forward_list>` | `<memory_resource>` | `<streambuf>` | |
52
- | `<fstream>` | `<mutex>` | `<string>` | |
53
- | `<functional>` | `<new>` | `<string_view>` | |
54
-
55
 
56
  The facilities of the C standard library are provided in the additional
57
- headers shown in Table  [[tab:cpp.c.headers]]. [^15]
58
 
59
- **Table: C++headers for C library facilities** <a id="tab:cpp.c.headers">[tab:cpp.c.headers]</a>
 
 
 
60
 
61
- | | | | | |
62
- | ------------ | ------------- | ------------- | ----------- | ----------- |
63
- | `<cassert>` | `<cinttypes>` | `<csignal>` | `<cstdio>` | `<cwchar>` |
64
- | `<ccomplex>` | `<ciso646>` | `<cstdalign>` | `<cstdlib>` | `<cwctype>` |
65
- | `<cctype>` | `<climits>` | `<cstdarg>` | `<cstring>` | |
66
- | `<cerrno>` | `<clocale>` | `<cstdbool>` | `<ctgmath>` | |
67
- | `<cfenv>` | `<cmath>` | `<cstddef>` | `<ctime>` | |
68
- | `<cfloat>` | `<csetjmp>` | `<cstdint>` | `<cuchar>` | |
69
 
 
70
 
71
- Except as noted in Clauses  [[library]] through  [[thread]] and Annex 
72
- [[depr]], the contents of each header `cname` is the same as that of the
73
- corresponding header `name.h` as specified in the C standard library
74
- (Clause  [[intro.refs]]). In the C++standard library, however, the
75
- declarations (except for names which are defined as macros in C) are
76
- within namespace scope ([[basic.scope.namespace]]) of the namespace
77
- `std`. It is unspecified whether these names (including any overloads
78
- added in Clauses  [[language.support]] through  [[thread]] and Annex 
79
- [[depr]]) are first declared within the global namespace scope and are
80
- then injected into namespace `std` by explicit *using-declaration*s (
81
- [[namespace.udecl]]).
 
 
 
 
 
 
82
 
83
  Names which are defined as macros in C shall be defined as macros in the
84
  C++ standard library, even if C grants license for implementation as
85
  functions.
86
 
87
- [*Note 1*: The names defined as macros in C include the following:
88
  `assert`, `offsetof`, `setjmp`, `va_arg`, `va_end`, and
89
  `va_start`. — *end note*]
90
 
91
  Names that are defined as functions in C shall be defined as functions
92
  in the C++ standard library.[^16]
93
 
94
- Identifiers that are keywords or operators in C++shall not be defined as
95
- macros in C++standard library headers.[^17]
96
 
97
  [[depr.c.headers]], C standard library headers, describes the effects of
98
  using the `name.h` (C header) form in a C++ program.[^18]
99
 
100
  Annex K of the C standard describes a large number of functions, with
@@ -105,68 +87,53 @@ service as the C library function with the unsuffixed name, but
105
  generally take an additional argument whose value is the size of the
106
  result array. If any C++ header is included, it is
107
  *implementation-defined* whether any of these names is declared in the
108
  global namespace. (None of them is declared in namespace `std`.)
109
 
110
- Table  [[tab:c.annex.k.names]] lists the Annex K names that may be
111
- declared in some header. These names are also subject to the
112
- restrictions of  [[macro.names]].
113
-
114
- **Table: C standard Annex K names** <a id="tab:c.annex.k.names">[tab:c.annex.k.names]</a>
115
-
116
- | | | | |
117
- | ---------------------- | -------------------------- | -------------- | ------------- |
118
- | `abort_handler_s` | `mbstowcs_s` | `strncat_s` | `vswscanf_s` |
119
- | `asctime_s` | `memcpy_s` | `strncpy_s` | `vwprintf_s` |
120
- | `bsearch_s` | `memmove_s` | `strtok_s` | `vwscanf_s` |
121
- | `constraint_handler_t` | `memset_s` | `swprintf_s` | `wcrtomb_s` |
122
- | `ctime_s` | `printf_s` | `swscanf_s` | `wcscat_s` |
123
- | `errno_t` | `qsort_s` | `tmpfile_s` | `wcscpy_s` |
124
- | `fopen_s` | `RSIZE_MAX` | `TMP_MAX_S` | `wcsncat_s` |
125
- | `fprintf_s` | `rsize_t` | `tmpnam_s` | `wcsncpy_s` |
126
- | `freopen_s` | `scanf_s` | `vfprintf_s` | `wcsnlen_s` |
127
- | `fscanf_s` | `set_constraint_handler_s` | `vfscanf_s` | `wcsrtombs_s` |
128
- | `fwprintf_s` | `snprintf_s` | `vfwprintf_s` | `wcstok_s` |
129
- | `fwscanf_s` | `snwprintf_s` | `vfwscanf_s` | `wcstombs_s` |
130
- | `getenv_s` | `sprintf_s` | `vprintf_s` | `wctomb_s` |
131
- | `gets_s` | `sscanf_s` | `vscanf_s` | `wmemcpy_s` |
132
- | `gmtime_s` | `strcat_s` | `vsnprintf_s` | `wmemmove_s` |
133
- | `ignore_handler_s` | `strcpy_s` | `vsnwprintf_s` | `wprintf_s` |
134
- | `L_tmpnam_s` | `strerror_s` | `vsprintf_s` | `wscanf_s` |
135
- | `localtime_s` | `strerrorlen_s` | `vsscanf_s` | |
136
- | `mbsrtowcs_s` | `strlen_s` | `vswprintf_s` | |
137
-
138
 
139
  #### Freestanding implementations <a id="compliance">[[compliance]]</a>
140
 
141
- Two kinds of implementations are defined: *hosted* and *freestanding* (
142
- [[intro.compliance]]). For a hosted implementation, this International
143
- Standard describes the set of available headers.
 
144
 
145
  A freestanding implementation has an *implementation-defined* set of
146
- headers. This set shall include at least the headers shown in Table 
147
- [[tab:cpp.headers.freestanding]].
148
 
149
- **Table: C++headers for freestanding implementations** <a id="tab:cpp.headers.freestanding">[tab:cpp.headers.freestanding]</a>
150
 
151
  | Subclause | | Header |
152
- | --------------------------------------------- | ------------------------- | --------------------------------- |
153
- | | | `<ciso646>` |
154
  | [[support.types]] | Types | `<cstddef>` |
155
- | [[support.limits]] | Implementation properties | `<cfloat>` `<limits>` `<climits>` |
156
  | [[cstdint]] | Integer types | `<cstdint>` |
157
  | [[support.start.term]] | Start and termination | `<cstdlib>` |
158
  | [[support.dynamic]] | Dynamic memory management | `<new>` |
159
  | [[support.rtti]] | Type identification | `<typeinfo>` |
 
160
  | [[support.exception]] | Exception handling | `<exception>` |
161
  | [[support.initlist]] | Initializer lists | `<initializer_list>` |
 
 
162
  | [[support.runtime]] | Other runtime support | `<cstdarg>` |
 
163
  | [[meta]] | Type traits | `<type_traits>` |
 
164
  | [[atomics]] | Atomics | `<atomic>` |
165
- | [[depr.cstdalign.syn]], [[depr.cstdbool.syn]] | Deprecated headers | `<cstdalign>` `<cstdbool>` |
166
 
167
 
168
  The supplied version of the header `<cstdlib>` shall declare at least
169
  the functions `abort`, `atexit`, `at_quick_exit`, `exit`, and
170
- `quick_exit` ([[support.start.term]]). The other headers listed in this
171
- table shall meet the same requirements as for a hosted implementation.
 
 
 
 
 
 
172
 
 
1
  ### Library contents and organization <a id="organization">[[organization]]</a>
2
 
3
+ [[contents]] describes the entities and macros defined in the C++
4
+ standard library. [[headers]] lists the standard library headers and
5
  some constraints on those headers. [[compliance]] lists requirements for
6
  a freestanding implementation of the C++ standard library.
7
 
8
  #### Library contents <a id="contents">[[contents]]</a>
9
 
10
+ The C++ standard library provides definitions for the entities and
11
+ macros described in the synopses of the C++ standard library headers
12
+ [[headers]], unless otherwise specified.
13
 
14
  All library entities except `operator new` and `operator delete` are
15
  defined within the namespace `std` or namespaces nested within namespace
16
  `std`.[^12] It is unspecified whether names declared in a specific
17
  namespace are declared directly in that namespace or in an inline
18
  namespace inside that namespace.[^13]
19
 
20
  Whenever a name `x` defined in the standard library is mentioned, the
21
  name `x` is assumed to be fully qualified as `::std::x`, unless
22
+ explicitly described otherwise. For example, if the *Effects:* element
23
  for library function `F` is described as calling library function `G`,
24
  the function `::std::G` is meant.
25
 
26
  #### Headers <a id="headers">[[headers]]</a>
27
 
28
  Each element of the C++ standard library is declared or defined (as
29
  appropriate) in a *header*.[^14]
30
 
31
  The C++ standard library provides the *C++ library headers*, shown in
32
+ [[headers.cpp]].
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  The facilities of the C standard library are provided in the additional
35
+ headers shown in [[headers.cpp.c]]. [^15]
36
 
37
+ The headers listed in [[headers.cpp]], or, for a freestanding
38
+ implementation, the subset of such headers that are provided by the
39
+ implementation, are collectively known as the
40
+ *importable C++ library headers*.
41
 
42
+ [*Note 1*: Importable C++ library headers can be imported as module
43
+ units [[module.import]]. *end note*]
 
 
 
 
 
 
44
 
45
+ [*Example 1*:
46
 
47
+ ``` cpp
48
+ import <vector>; // imports the <vector> header unit
49
+ std::vector<int> vi; // OK
50
+ ```
51
+
52
+ *end example*]
53
+
54
+ Except as noted in [[library]] through [[thread]] and [[depr]], the
55
+ contents of each header `cname` is the same as that of the corresponding
56
+ header `name.h` as specified in the C standard library [[intro.refs]].
57
+ In the C++ standard library, however, the declarations (except for names
58
+ which are defined as macros in C) are within namespace scope
59
+ [[basic.scope.namespace]] of the namespace `std`. It is unspecified
60
+ whether these names (including any overloads added in [[support]]
61
+ through [[thread]] and [[depr]]) are first declared within the global
62
+ namespace scope and are then injected into namespace `std` by explicit
63
+ *using-declaration*s [[namespace.udecl]].
64
 
65
  Names which are defined as macros in C shall be defined as macros in the
66
  C++ standard library, even if C grants license for implementation as
67
  functions.
68
 
69
+ [*Note 2*: The names defined as macros in C include the following:
70
  `assert`, `offsetof`, `setjmp`, `va_arg`, `va_end`, and
71
  `va_start`. — *end note*]
72
 
73
  Names that are defined as functions in C shall be defined as functions
74
  in the C++ standard library.[^16]
75
 
76
+ Identifiers that are keywords or operators in C++ shall not be defined
77
+ as macros in C++ standard library headers.[^17]
78
 
79
  [[depr.c.headers]], C standard library headers, describes the effects of
80
  using the `name.h` (C header) form in a C++ program.[^18]
81
 
82
  Annex K of the C standard describes a large number of functions, with
 
87
  generally take an additional argument whose value is the size of the
88
  result array. If any C++ header is included, it is
89
  *implementation-defined* whether any of these names is declared in the
90
  global namespace. (None of them is declared in namespace `std`.)
91
 
92
+ [[c.annex.k.names]] lists the Annex K names that may be declared in some
93
+ header. These names are also subject to the restrictions of 
94
+ [[macro.names]].
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  #### Freestanding implementations <a id="compliance">[[compliance]]</a>
97
 
98
+ Two kinds of implementations are defined: *hosted* and *freestanding*
99
+ [[intro.compliance]]; the kind of the implementation is
100
+ *implementation-defined*. For a hosted implementation, this document
101
+ describes the set of available headers.
102
 
103
  A freestanding implementation has an *implementation-defined* set of
104
+ headers. This set shall include at least the headers shown in
105
+ [[headers.cpp.fs]].
106
 
107
+ **Table: C++ headers for freestanding implementations** <a id="headers.cpp.fs">[headers.cpp.fs]</a>
108
 
109
  | Subclause | | Header |
110
+ | ---------------------- | ------------------------- | ------------------------------------------------ |
 
111
  | [[support.types]] | Types | `<cstddef>` |
112
+ | [[support.limits]] | Implementation properties | `<cfloat>`, `<climits>`, `<limits>`, `<version>` |
113
  | [[cstdint]] | Integer types | `<cstdint>` |
114
  | [[support.start.term]] | Start and termination | `<cstdlib>` |
115
  | [[support.dynamic]] | Dynamic memory management | `<new>` |
116
  | [[support.rtti]] | Type identification | `<typeinfo>` |
117
+ | [[support.srcloc]] | Source location | `<source_location>` |
118
  | [[support.exception]] | Exception handling | `<exception>` |
119
  | [[support.initlist]] | Initializer lists | `<initializer_list>` |
120
+ | [[cmp]] | Comparisons | `<compare>` |
121
+ | [[support.coroutine]] | Coroutines support | `<coroutine>` |
122
  | [[support.runtime]] | Other runtime support | `<cstdarg>` |
123
+ | [[concepts]] | Concepts library | `<concepts>` |
124
  | [[meta]] | Type traits | `<type_traits>` |
125
+ | [[bit]] | Bit manipulation | `<bit>` |
126
  | [[atomics]] | Atomics | `<atomic>` |
 
127
 
128
 
129
  The supplied version of the header `<cstdlib>` shall declare at least
130
  the functions `abort`, `atexit`, `at_quick_exit`, `exit`, and
131
+ `quick_exit` [[support.start.term]]. The supplied version of the header
132
+ `<atomic>` shall meet the same requirements as for a hosted
133
+ implementation except that support for always lock-free integral atomic
134
+ types [[atomics.lockfree]] is *implementation-defined*, and whether or
135
+ not the type aliases `atomic_signed_lock_free` and
136
+ `atomic_unsigned_lock_free` are defined [[atomics.alias]] is
137
+ *implementation-defined*. The other headers listed in this table shall
138
+ meet the same requirements as for a hosted implementation.
139