tmp/tmpf6wpcsbw/{from.md → to.md}
RENAMED
|
@@ -28,10 +28,14 @@ library requirements for the original template.[^21]
|
|
| 28 |
The behavior of a C++ program is undefined if it declares an explicit or
|
| 29 |
partial specialization of any standard library variable template, except
|
| 30 |
where explicitly permitted by the specification of that variable
|
| 31 |
template.
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
The behavior of a C++ program is undefined if it declares
|
| 34 |
|
| 35 |
- an explicit specialization of any member function of a standard
|
| 36 |
library class template, or
|
| 37 |
- an explicit specialization of any member function template of a
|
|
@@ -50,41 +54,30 @@ standard library static member function, or an instantiation of a
|
|
| 50 |
standard library function template. Unless `F` is designated an
|
| 51 |
*addressable function*, the behavior of a C++ program is unspecified
|
| 52 |
(possibly ill-formed) if it explicitly or implicitly attempts to form a
|
| 53 |
pointer to `F`.
|
| 54 |
|
| 55 |
-
[*Note
|
| 56 |
of the unary `&` operator [[expr.unary.op]], `addressof`
|
| 57 |
[[specialized.addressof]], or a function-to-pointer standard conversion
|
| 58 |
[[conv.func]]. — *end note*]
|
| 59 |
|
| 60 |
Moreover, the behavior of a C++ program is unspecified (possibly
|
| 61 |
ill-formed) if it attempts to form a reference to `F` or if it attempts
|
| 62 |
to form a pointer-to-member designating either a standard library
|
| 63 |
non-static member function [[member.functions]] or an instantiation of a
|
| 64 |
standard library member function template.
|
| 65 |
|
| 66 |
-
Other than in namespace `std` or in a namespace within namespace `std`,
|
| 67 |
-
a program may provide an overload for any library function template
|
| 68 |
-
designated as a *customization point*, provided that (a) the overload’s
|
| 69 |
-
declaration depends on at least one user-defined type and (b) the
|
| 70 |
-
overload meets the standard library requirements for the customization
|
| 71 |
-
point. [^22]
|
| 72 |
-
|
| 73 |
-
[*Note 2*: This permits a (qualified or unqualified) call to the
|
| 74 |
-
customization point to invoke the most appropriate overload for the
|
| 75 |
-
given arguments. — *end note*]
|
| 76 |
-
|
| 77 |
A translation unit shall not declare namespace `std` to be an inline
|
| 78 |
namespace [[namespace.def]].
|
| 79 |
|
| 80 |
##### Namespace `posix` <a id="namespace.posix">[[namespace.posix]]</a>
|
| 81 |
|
| 82 |
The behavior of a C++ program is undefined if it adds declarations or
|
| 83 |
definitions to namespace `posix` or to a namespace within namespace
|
| 84 |
`posix` unless otherwise specified. The namespace `posix` is reserved
|
| 85 |
-
for use by ISO/IEC 9945 and other POSIX standards.
|
| 86 |
|
| 87 |
##### Namespaces for future standardization <a id="namespace.future">[[namespace.future]]</a>
|
| 88 |
|
| 89 |
Top-level namespaces whose *namespace-name* consists of `std` followed
|
| 90 |
by one or more *digit*s [[lex.name]] are reserved for future
|
|
@@ -94,18 +87,20 @@ declarations or definitions to such a namespace.
|
|
| 94 |
[*Example 1*: The top-level namespace `std2` is reserved for use by
|
| 95 |
future revisions of this International Standard. — *end example*]
|
| 96 |
|
| 97 |
#### Reserved names <a id="reserved.names">[[reserved.names]]</a>
|
| 98 |
|
|
|
|
|
|
|
| 99 |
The C++ standard library reserves the following kinds of names:
|
| 100 |
|
| 101 |
- macros
|
| 102 |
- global names
|
| 103 |
- names with external linkage
|
| 104 |
|
| 105 |
If a program declares or defines a name in a context where it is
|
| 106 |
-
reserved, other than as explicitly allowed by
|
| 107 |
is undefined.
|
| 108 |
|
| 109 |
##### Zombie names <a id="zombie.names">[[zombie.names]]</a>
|
| 110 |
|
| 111 |
In namespace `std`, the following names are reserved for previous
|
|
@@ -121,10 +116,13 @@ standardization:
|
|
| 121 |
- `binder2nd`,
|
| 122 |
- `const_mem_fun1_ref_t`,
|
| 123 |
- `const_mem_fun1_t`,
|
| 124 |
- `const_mem_fun_ref_t`,
|
| 125 |
- `const_mem_fun_t`,
|
|
|
|
|
|
|
|
|
|
| 126 |
- `get_temporary_buffer`,
|
| 127 |
- `get_unexpected`,
|
| 128 |
- `gets`,
|
| 129 |
- `is_literal_type`,
|
| 130 |
- `is_literal_type_v`,
|
|
@@ -134,10 +132,11 @@ standardization:
|
|
| 134 |
- `mem_fun_ref`,
|
| 135 |
- `mem_fun_t`,
|
| 136 |
- `mem_fun`,
|
| 137 |
- `not1`,
|
| 138 |
- `not2`,
|
|
|
|
| 139 |
- `pointer_to_binary_function`,
|
| 140 |
- `pointer_to_unary_function`,
|
| 141 |
- `ptr_fun`,
|
| 142 |
- `random_shuffle`,
|
| 143 |
- `raw_storage_iterator`,
|
|
@@ -146,23 +145,26 @@ standardization:
|
|
| 146 |
- `return_temporary_buffer`,
|
| 147 |
- `set_unexpected`,
|
| 148 |
- `unary_function`,
|
| 149 |
- `unary_negate`,
|
| 150 |
- `uncaught_exception`,
|
| 151 |
-
- `
|
|
|
|
| 152 |
- `unexpected_handler`.
|
| 153 |
|
| 154 |
-
The following names are reserved as
|
| 155 |
standardization, and may not be used as a name for object-like macros in
|
| 156 |
portable code:
|
| 157 |
|
| 158 |
- `argument_type`,
|
| 159 |
- `first_argument_type`,
|
| 160 |
- `io_state`,
|
| 161 |
- `open_mode`,
|
| 162 |
-
- `
|
| 163 |
-
- `
|
|
|
|
|
|
|
| 164 |
|
| 165 |
The name `stossc` is reserved as a member function for previous
|
| 166 |
standardization, and may not be used as a name for function-like macros
|
| 167 |
in portable code.
|
| 168 |
|
|
@@ -182,36 +184,40 @@ defined as function-like macros [[cpp.replace]].
|
|
| 182 |
|
| 183 |
##### External linkage <a id="extern.names">[[extern.names]]</a>
|
| 184 |
|
| 185 |
Each name declared as an object with external linkage in a header is
|
| 186 |
reserved to the implementation to designate that library object with
|
| 187 |
-
external linkage, [^
|
| 188 |
-
|
|
|
|
| 189 |
|
| 190 |
Each global function signature declared with external linkage in a
|
| 191 |
header is reserved to the implementation to designate that function
|
| 192 |
-
signature with external linkage.[^
|
| 193 |
|
| 194 |
Each name from the C standard library declared with external linkage is
|
| 195 |
reserved to the implementation for use as a name with `extern "C"`
|
| 196 |
linkage, both in namespace `std` and in the global namespace.
|
| 197 |
|
| 198 |
Each function signature from the C standard library declared with
|
| 199 |
external linkage is reserved to the implementation for use as a function
|
| 200 |
-
signature with both `extern "C"` and `extern "C++"` linkage,[^
|
| 201 |
-
|
|
|
|
| 202 |
|
| 203 |
##### Types <a id="extern.types">[[extern.types]]</a>
|
| 204 |
|
| 205 |
For each type `T` from the C standard library, the types `::T` and
|
| 206 |
`std::T` are reserved to the implementation and, when defined, `::T`
|
| 207 |
shall be identical to `std::T`.
|
| 208 |
|
| 209 |
##### User-defined literal suffixes <a id="usrlit.suffix">[[usrlit.suffix]]</a>
|
| 210 |
|
| 211 |
Literal suffix identifiers [[over.literal]] that do not start with an
|
| 212 |
-
underscore are reserved for future standardization.
|
|
|
|
|
|
|
| 213 |
|
| 214 |
#### Headers <a id="alt.headers">[[alt.headers]]</a>
|
| 215 |
|
| 216 |
If a file with a name equivalent to the derived file name for one of the
|
| 217 |
C++ standard library headers is not provided as part of the
|
|
@@ -228,15 +234,15 @@ program [[class.virtual]].
|
|
| 228 |
#### Replacement functions <a id="replacement.functions">[[replacement.functions]]</a>
|
| 229 |
|
| 230 |
[[support]] through [[thread]] and [[depr]] describe the behavior of
|
| 231 |
numerous functions defined by the C++ standard library. Under some
|
| 232 |
circumstances, however, certain of these function descriptions also
|
| 233 |
-
apply to replacement functions defined in the program
|
| 234 |
|
| 235 |
A C++ program may provide the definition for any of the following
|
| 236 |
-
dynamic memory allocation function signatures declared in header
|
| 237 |
-
|
| 238 |
|
| 239 |
``` cpp
|
| 240 |
operator new(std::size_t)
|
| 241 |
operator new(std::size_t, std::align_val_t)
|
| 242 |
operator new(std::size_t, const std::nothrow_t&)
|
|
@@ -268,11 +274,11 @@ operator delete[](void*, const std::nothrow_t&)
|
|
| 268 |
operator delete[](void*, std::align_val_t, const std::nothrow_t&)
|
| 269 |
```
|
| 270 |
|
| 271 |
The program’s definitions are used instead of the default versions
|
| 272 |
supplied by the implementation [[new.delete]]. Such replacement occurs
|
| 273 |
-
prior to program startup
|
| 274 |
program’s declarations shall not be specified as `inline`. No diagnostic
|
| 275 |
is required.
|
| 276 |
|
| 277 |
#### Handler functions <a id="handler.functions">[[handler.functions]]</a>
|
| 278 |
|
|
@@ -308,31 +314,30 @@ In certain cases (replacement functions, handler functions, operations
|
|
| 308 |
on types used to instantiate standard library template components), the
|
| 309 |
C++ standard library depends on components supplied by a C++ program. If
|
| 310 |
these components do not meet their requirements, this document places no
|
| 311 |
requirements on the implementation.
|
| 312 |
|
| 313 |
-
In particular, the
|
| 314 |
|
| 315 |
- For replacement functions [[new.delete]], if the installed replacement
|
| 316 |
function does not implement the semantics of the applicable *Required
|
| 317 |
behavior:* paragraph.
|
| 318 |
-
- For handler functions
|
| 319 |
-
|
| 320 |
applicable *Required behavior:* paragraph.
|
| 321 |
- For types used as template arguments when instantiating a template
|
| 322 |
component, if the operations on the type do not implement the
|
| 323 |
-
semantics of the applicable *Requirements* subclause
|
| 324 |
-
[[allocator.requirements]], [[container.requirements]],
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
failure by throwing an exception unless otherwise specified.
|
| 328 |
- If any replacement function or handler function or destructor
|
| 329 |
operation exits via an exception, unless specifically allowed in the
|
| 330 |
applicable *Required behavior:* paragraph.
|
| 331 |
-
- If an incomplete type [[
|
| 332 |
-
when instantiating a template component or evaluating a
|
| 333 |
-
unless specifically allowed for that component.
|
| 334 |
|
| 335 |
#### Function arguments <a id="res.on.arguments">[[res.on.arguments]]</a>
|
| 336 |
|
| 337 |
Each of the following applies to all arguments to functions defined in
|
| 338 |
the C++ standard library, unless explicitly stated otherwise.
|
|
@@ -343,22 +348,23 @@ the C++ standard library, unless explicitly stated otherwise.
|
|
| 343 |
- If a function argument is described as being an array, the pointer
|
| 344 |
actually passed to the function shall have a value such that all
|
| 345 |
address computations and accesses to objects (that would be valid if
|
| 346 |
the pointer did point to the first element of such an array) are in
|
| 347 |
fact valid.
|
| 348 |
-
- If a function argument
|
| 349 |
implementation may assume that this parameter is a unique reference to
|
| 350 |
-
this argument
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
|
|
|
| 360 |
|
| 361 |
#### Library object access <a id="res.on.objects">[[res.on.objects]]</a>
|
| 362 |
|
| 363 |
The behavior of a program is undefined if calls to standard library
|
| 364 |
functions from different threads may introduce a data race. The
|
|
@@ -376,15 +382,10 @@ access, or the access does not happen before the end of the object’s
|
|
| 376 |
lifetime, the behavior is undefined unless otherwise specified.
|
| 377 |
|
| 378 |
[*Note 2*: This applies even to objects such as mutexes intended for
|
| 379 |
thread synchronization. — *end note*]
|
| 380 |
|
| 381 |
-
#### Expects paragraph <a id="res.on.expects">[[res.on.expects]]</a>
|
| 382 |
-
|
| 383 |
-
Violation of any preconditions specified in a function’s
|
| 384 |
-
*Preconditions:* element results in undefined behavior.
|
| 385 |
-
|
| 386 |
#### Semantic requirements <a id="res.on.requirements">[[res.on.requirements]]</a>
|
| 387 |
|
| 388 |
A sequence `Args` of template arguments is said to *model* a concept `C`
|
| 389 |
if `Args` satisfies `C` [[temp.constr.decl]] and meets all semantic
|
| 390 |
requirements (if any) given in the specification of `C`.
|
|
|
|
| 28 |
The behavior of a C++ program is undefined if it declares an explicit or
|
| 29 |
partial specialization of any standard library variable template, except
|
| 30 |
where explicitly permitted by the specification of that variable
|
| 31 |
template.
|
| 32 |
|
| 33 |
+
[*Note 1*: The requirements on an explicit or partial specialization
|
| 34 |
+
are stated by each variable template that grants such
|
| 35 |
+
permission. — *end note*]
|
| 36 |
+
|
| 37 |
The behavior of a C++ program is undefined if it declares
|
| 38 |
|
| 39 |
- an explicit specialization of any member function of a standard
|
| 40 |
library class template, or
|
| 41 |
- an explicit specialization of any member function template of a
|
|
|
|
| 54 |
standard library function template. Unless `F` is designated an
|
| 55 |
*addressable function*, the behavior of a C++ program is unspecified
|
| 56 |
(possibly ill-formed) if it explicitly or implicitly attempts to form a
|
| 57 |
pointer to `F`.
|
| 58 |
|
| 59 |
+
[*Note 2*: Possible means of forming such pointers include application
|
| 60 |
of the unary `&` operator [[expr.unary.op]], `addressof`
|
| 61 |
[[specialized.addressof]], or a function-to-pointer standard conversion
|
| 62 |
[[conv.func]]. — *end note*]
|
| 63 |
|
| 64 |
Moreover, the behavior of a C++ program is unspecified (possibly
|
| 65 |
ill-formed) if it attempts to form a reference to `F` or if it attempts
|
| 66 |
to form a pointer-to-member designating either a standard library
|
| 67 |
non-static member function [[member.functions]] or an instantiation of a
|
| 68 |
standard library member function template.
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
A translation unit shall not declare namespace `std` to be an inline
|
| 71 |
namespace [[namespace.def]].
|
| 72 |
|
| 73 |
##### Namespace `posix` <a id="namespace.posix">[[namespace.posix]]</a>
|
| 74 |
|
| 75 |
The behavior of a C++ program is undefined if it adds declarations or
|
| 76 |
definitions to namespace `posix` or to a namespace within namespace
|
| 77 |
`posix` unless otherwise specified. The namespace `posix` is reserved
|
| 78 |
+
for use by ISO/IEC/IEEE 9945 and other POSIX standards.
|
| 79 |
|
| 80 |
##### Namespaces for future standardization <a id="namespace.future">[[namespace.future]]</a>
|
| 81 |
|
| 82 |
Top-level namespaces whose *namespace-name* consists of `std` followed
|
| 83 |
by one or more *digit*s [[lex.name]] are reserved for future
|
|
|
|
| 87 |
[*Example 1*: The top-level namespace `std2` is reserved for use by
|
| 88 |
future revisions of this International Standard. — *end example*]
|
| 89 |
|
| 90 |
#### Reserved names <a id="reserved.names">[[reserved.names]]</a>
|
| 91 |
|
| 92 |
+
##### General <a id="reserved.names.general">[[reserved.names.general]]</a>
|
| 93 |
+
|
| 94 |
The C++ standard library reserves the following kinds of names:
|
| 95 |
|
| 96 |
- macros
|
| 97 |
- global names
|
| 98 |
- names with external linkage
|
| 99 |
|
| 100 |
If a program declares or defines a name in a context where it is
|
| 101 |
+
reserved, other than as explicitly allowed by [[library]], its behavior
|
| 102 |
is undefined.
|
| 103 |
|
| 104 |
##### Zombie names <a id="zombie.names">[[zombie.names]]</a>
|
| 105 |
|
| 106 |
In namespace `std`, the following names are reserved for previous
|
|
|
|
| 116 |
- `binder2nd`,
|
| 117 |
- `const_mem_fun1_ref_t`,
|
| 118 |
- `const_mem_fun1_t`,
|
| 119 |
- `const_mem_fun_ref_t`,
|
| 120 |
- `const_mem_fun_t`,
|
| 121 |
+
- `declare_no_pointers`,
|
| 122 |
+
- `declare_reachable`,
|
| 123 |
+
- `get_pointer_safety`,
|
| 124 |
- `get_temporary_buffer`,
|
| 125 |
- `get_unexpected`,
|
| 126 |
- `gets`,
|
| 127 |
- `is_literal_type`,
|
| 128 |
- `is_literal_type_v`,
|
|
|
|
| 132 |
- `mem_fun_ref`,
|
| 133 |
- `mem_fun_t`,
|
| 134 |
- `mem_fun`,
|
| 135 |
- `not1`,
|
| 136 |
- `not2`,
|
| 137 |
+
- `pointer_safety`,
|
| 138 |
- `pointer_to_binary_function`,
|
| 139 |
- `pointer_to_unary_function`,
|
| 140 |
- `ptr_fun`,
|
| 141 |
- `random_shuffle`,
|
| 142 |
- `raw_storage_iterator`,
|
|
|
|
| 145 |
- `return_temporary_buffer`,
|
| 146 |
- `set_unexpected`,
|
| 147 |
- `unary_function`,
|
| 148 |
- `unary_negate`,
|
| 149 |
- `uncaught_exception`,
|
| 150 |
+
- `undeclare_no_pointers`,
|
| 151 |
+
- `undeclare_reachable`, and
|
| 152 |
- `unexpected_handler`.
|
| 153 |
|
| 154 |
+
The following names are reserved as members for previous
|
| 155 |
standardization, and may not be used as a name for object-like macros in
|
| 156 |
portable code:
|
| 157 |
|
| 158 |
- `argument_type`,
|
| 159 |
- `first_argument_type`,
|
| 160 |
- `io_state`,
|
| 161 |
- `open_mode`,
|
| 162 |
+
- `preferred`,
|
| 163 |
+
- `second_argument_type`,
|
| 164 |
+
- `seek_dir`, and.
|
| 165 |
+
- `strict`.
|
| 166 |
|
| 167 |
The name `stossc` is reserved as a member function for previous
|
| 168 |
standardization, and may not be used as a name for function-like macros
|
| 169 |
in portable code.
|
| 170 |
|
|
|
|
| 184 |
|
| 185 |
##### External linkage <a id="extern.names">[[extern.names]]</a>
|
| 186 |
|
| 187 |
Each name declared as an object with external linkage in a header is
|
| 188 |
reserved to the implementation to designate that library object with
|
| 189 |
+
external linkage, [^22]
|
| 190 |
+
|
| 191 |
+
both in namespace `std` and in the global namespace.
|
| 192 |
|
| 193 |
Each global function signature declared with external linkage in a
|
| 194 |
header is reserved to the implementation to designate that function
|
| 195 |
+
signature with external linkage.[^23]
|
| 196 |
|
| 197 |
Each name from the C standard library declared with external linkage is
|
| 198 |
reserved to the implementation for use as a name with `extern "C"`
|
| 199 |
linkage, both in namespace `std` and in the global namespace.
|
| 200 |
|
| 201 |
Each function signature from the C standard library declared with
|
| 202 |
external linkage is reserved to the implementation for use as a function
|
| 203 |
+
signature with both `extern "C"` and `extern "C++"` linkage,[^24]
|
| 204 |
+
|
| 205 |
+
or as a name of namespace scope in the global namespace.
|
| 206 |
|
| 207 |
##### Types <a id="extern.types">[[extern.types]]</a>
|
| 208 |
|
| 209 |
For each type `T` from the C standard library, the types `::T` and
|
| 210 |
`std::T` are reserved to the implementation and, when defined, `::T`
|
| 211 |
shall be identical to `std::T`.
|
| 212 |
|
| 213 |
##### User-defined literal suffixes <a id="usrlit.suffix">[[usrlit.suffix]]</a>
|
| 214 |
|
| 215 |
Literal suffix identifiers [[over.literal]] that do not start with an
|
| 216 |
+
underscore are reserved for future standardization. Literal suffix
|
| 217 |
+
identifiers that contain a double underscore `__` are reserved for use
|
| 218 |
+
by C++ implementations.
|
| 219 |
|
| 220 |
#### Headers <a id="alt.headers">[[alt.headers]]</a>
|
| 221 |
|
| 222 |
If a file with a name equivalent to the derived file name for one of the
|
| 223 |
C++ standard library headers is not provided as part of the
|
|
|
|
| 234 |
#### Replacement functions <a id="replacement.functions">[[replacement.functions]]</a>
|
| 235 |
|
| 236 |
[[support]] through [[thread]] and [[depr]] describe the behavior of
|
| 237 |
numerous functions defined by the C++ standard library. Under some
|
| 238 |
circumstances, however, certain of these function descriptions also
|
| 239 |
+
apply to replacement functions defined in the program.
|
| 240 |
|
| 241 |
A C++ program may provide the definition for any of the following
|
| 242 |
+
dynamic memory allocation function signatures declared in header `<new>`
|
| 243 |
+
[[basic.stc.dynamic]], [[new.syn]]:
|
| 244 |
|
| 245 |
``` cpp
|
| 246 |
operator new(std::size_t)
|
| 247 |
operator new(std::size_t, std::align_val_t)
|
| 248 |
operator new(std::size_t, const std::nothrow_t&)
|
|
|
|
| 274 |
operator delete[](void*, std::align_val_t, const std::nothrow_t&)
|
| 275 |
```
|
| 276 |
|
| 277 |
The program’s definitions are used instead of the default versions
|
| 278 |
supplied by the implementation [[new.delete]]. Such replacement occurs
|
| 279 |
+
prior to program startup [[basic.def.odr]], [[basic.start]]. The
|
| 280 |
program’s declarations shall not be specified as `inline`. No diagnostic
|
| 281 |
is required.
|
| 282 |
|
| 283 |
#### Handler functions <a id="handler.functions">[[handler.functions]]</a>
|
| 284 |
|
|
|
|
| 314 |
on types used to instantiate standard library template components), the
|
| 315 |
C++ standard library depends on components supplied by a C++ program. If
|
| 316 |
these components do not meet their requirements, this document places no
|
| 317 |
requirements on the implementation.
|
| 318 |
|
| 319 |
+
In particular, the behavior is undefined in the following cases:
|
| 320 |
|
| 321 |
- For replacement functions [[new.delete]], if the installed replacement
|
| 322 |
function does not implement the semantics of the applicable *Required
|
| 323 |
behavior:* paragraph.
|
| 324 |
+
- For handler functions [[new.handler]], [[terminate.handler]], if the
|
| 325 |
+
installed handler function does not implement the semantics of the
|
| 326 |
applicable *Required behavior:* paragraph.
|
| 327 |
- For types used as template arguments when instantiating a template
|
| 328 |
component, if the operations on the type do not implement the
|
| 329 |
+
semantics of the applicable *Requirements* subclause
|
| 330 |
+
[[allocator.requirements]], [[container.requirements]], [[iterator.requirements]], [[algorithms.requirements]], [[numeric.requirements]].
|
| 331 |
+
Operations on such types can report a failure by throwing an exception
|
| 332 |
+
unless otherwise specified.
|
|
|
|
| 333 |
- If any replacement function or handler function or destructor
|
| 334 |
operation exits via an exception, unless specifically allowed in the
|
| 335 |
applicable *Required behavior:* paragraph.
|
| 336 |
+
- If an incomplete type [[term.incomplete.type]] is used as a template
|
| 337 |
+
argument when instantiating a template component or evaluating a
|
| 338 |
+
concept, unless specifically allowed for that component.
|
| 339 |
|
| 340 |
#### Function arguments <a id="res.on.arguments">[[res.on.arguments]]</a>
|
| 341 |
|
| 342 |
Each of the following applies to all arguments to functions defined in
|
| 343 |
the C++ standard library, unless explicitly stated otherwise.
|
|
|
|
| 348 |
- If a function argument is described as being an array, the pointer
|
| 349 |
actually passed to the function shall have a value such that all
|
| 350 |
address computations and accesses to objects (that would be valid if
|
| 351 |
the pointer did point to the first element of such an array) are in
|
| 352 |
fact valid.
|
| 353 |
+
- If a function argument is bound to an rvalue reference parameter, the
|
| 354 |
implementation may assume that this parameter is a unique reference to
|
| 355 |
+
this argument, except that the argument passed to a move-assignment
|
| 356 |
+
operator may be a reference to `*this` [[lib.types.movedfrom]].
|
| 357 |
+
\[*Note 1*: If the type of a parameter is a forwarding reference
|
| 358 |
+
[[temp.deduct.call]] that is deduced to an lvalue reference type, then
|
| 359 |
+
the argument is not bound to an rvalue reference. — *end note*]
|
| 360 |
+
\[*Note 2*: If a program casts an lvalue to an xvalue while passing
|
| 361 |
+
that lvalue to a library function (e.g., by calling the function with
|
| 362 |
+
the argument `std::move(x)`), the program is effectively asking that
|
| 363 |
+
function to treat that lvalue as a temporary object. The
|
| 364 |
+
implementation is free to optimize away aliasing checks which would
|
| 365 |
+
possibly be needed if the argument was an lvalue. — *end note*]
|
| 366 |
|
| 367 |
#### Library object access <a id="res.on.objects">[[res.on.objects]]</a>
|
| 368 |
|
| 369 |
The behavior of a program is undefined if calls to standard library
|
| 370 |
functions from different threads may introduce a data race. The
|
|
|
|
| 382 |
lifetime, the behavior is undefined unless otherwise specified.
|
| 383 |
|
| 384 |
[*Note 2*: This applies even to objects such as mutexes intended for
|
| 385 |
thread synchronization. — *end note*]
|
| 386 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
#### Semantic requirements <a id="res.on.requirements">[[res.on.requirements]]</a>
|
| 388 |
|
| 389 |
A sequence `Args` of template arguments is said to *model* a concept `C`
|
| 390 |
if `Args` satisfies `C` [[temp.constr.decl]] and meets all semantic
|
| 391 |
requirements (if any) given in the specification of `C`.
|