- tmp/tmparyjqvlo/{from.md → to.md} +100 -33
tmp/tmparyjqvlo/{from.md → to.md}
RENAMED
|
@@ -3,16 +3,21 @@
|
|
| 3 |
#### Overview <a id="conforming.overview">[[conforming.overview]]</a>
|
| 4 |
|
| 5 |
Subclause [[conforming]] describes the constraints upon, and latitude
|
| 6 |
of, implementations of the C++ standard library.
|
| 7 |
|
| 8 |
-
An implementation’s use of
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
#### Headers <a id="res.on.headers">[[res.on.headers]]</a>
|
| 16 |
|
| 17 |
A C++ header may include other C++ headers. A C++ header shall provide
|
| 18 |
the declarations and definitions that appear in its synopsis. A C++
|
|
@@ -42,11 +47,11 @@ stated otherwise.
|
|
| 42 |
|
| 43 |
It is unspecified whether any non-member functions in the C++ standard
|
| 44 |
library are defined as inline [[dcl.inline]].
|
| 45 |
|
| 46 |
A call to a non-member function signature described in [[support]]
|
| 47 |
-
through [[
|
| 48 |
declared no additional non-member function signatures.[^25]
|
| 49 |
|
| 50 |
An implementation shall not declare a non-member function signature with
|
| 51 |
additional default arguments.
|
| 52 |
|
|
@@ -94,12 +99,12 @@ signatures for a member function name. — *end note*]
|
|
| 94 |
Whenever this document specifies a friend declaration of a function or
|
| 95 |
function template within a class or class template definition, that
|
| 96 |
declaration shall be the only declaration of that function or function
|
| 97 |
template provided by an implementation.
|
| 98 |
|
| 99 |
-
[*Note 1*: In particular,
|
| 100 |
-
|
| 101 |
namespace scope. — *end note*]
|
| 102 |
|
| 103 |
[*Note 2*: Such a friend function or function template declaration is
|
| 104 |
known as a hidden friend, as it is visible neither to ordinary
|
| 105 |
unqualified lookup [[basic.lookup.unqual]] nor to qualified lookup
|
|
@@ -109,12 +114,12 @@ unqualified lookup [[basic.lookup.unqual]] nor to qualified lookup
|
|
| 109 |
|
| 110 |
This document explicitly requires that certain standard library
|
| 111 |
functions are `constexpr` [[dcl.constexpr]]. An implementation shall not
|
| 112 |
declare any standard library function signature as `constexpr` except
|
| 113 |
for those where it is explicitly required. Within any header that
|
| 114 |
-
provides any non-defining declarations of constexpr functions
|
| 115 |
-
|
| 116 |
|
| 117 |
#### Requirements for stable algorithms <a id="algorithm.stable">[[algorithm.stable]]</a>
|
| 118 |
|
| 119 |
When the requirements for an algorithm state that it is “stable” without
|
| 120 |
further elaboration, it means:
|
|
@@ -179,14 +184,32 @@ all operations solely within the current thread if those operations have
|
|
| 179 |
effects that are visible [[intro.multithread]] to users.
|
| 180 |
|
| 181 |
[*Note 3*: This allows implementations to parallelize operations if
|
| 182 |
there are no visible side effects. — *end note*]
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
#### Protection within classes <a id="protection.within.classes">[[protection.within.classes]]</a>
|
| 185 |
|
| 186 |
It is unspecified whether any function signature or class described in
|
| 187 |
-
[[support]] through [[
|
| 188 |
in the C++ standard library.
|
| 189 |
|
| 190 |
#### Derived classes <a id="derivation">[[derivation]]</a>
|
| 191 |
|
| 192 |
An implementation may derive any class in the C++ standard library from
|
|
@@ -214,21 +237,22 @@ types unless otherwise specified.
|
|
| 214 |
#### Restrictions on exception handling <a id="res.on.exception.handling">[[res.on.exception.handling]]</a>
|
| 215 |
|
| 216 |
Any of the functions defined in the C++ standard library can report a
|
| 217 |
failure by throwing an exception of a type described in its *Throws:*
|
| 218 |
paragraph, or of a type derived from a type named in the *Throws:*
|
| 219 |
-
paragraph that would be caught by
|
| 220 |
-
type.
|
| 221 |
|
| 222 |
Functions from the C standard library shall not throw exceptions [^26]
|
| 223 |
|
| 224 |
except when such a function calls a program-supplied function that
|
| 225 |
throws an exception.[^27]
|
| 226 |
|
| 227 |
Destructor operations defined in the C++ standard library shall not
|
| 228 |
throw exceptions. Every destructor in the C++ standard library shall
|
| 229 |
-
behave as if it had a non-throwing exception specification
|
|
|
|
| 230 |
|
| 231 |
Functions defined in the C++ standard library that do not have a
|
| 232 |
*Throws:* paragraph but do have a potentially-throwing exception
|
| 233 |
specification may throw *implementation-defined* exceptions.[^28]
|
| 234 |
|
|
@@ -237,15 +261,22 @@ derived from the standard exception classes
|
|
| 237 |
[[bad.alloc]], [[support.exception]], [[std.exceptions]].
|
| 238 |
|
| 239 |
An implementation may strengthen the exception specification for a
|
| 240 |
non-virtual function by adding a non-throwing exception specification.
|
| 241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
#### Value of error codes <a id="value.error.codes">[[value.error.codes]]</a>
|
| 243 |
|
| 244 |
Certain functions in the C++ standard library report errors via a
|
| 245 |
-
`
|
| 246 |
-
`category()` member shall return `
|
| 247 |
originating from the operating system, or a reference to an
|
| 248 |
*implementation-defined* `error_category` object for errors originating
|
| 249 |
elsewhere. The implementation shall define the possible values of
|
| 250 |
`value()` for each of these error categories.
|
| 251 |
|
|
@@ -261,56 +292,65 @@ associated values. — *end example*]
|
|
| 261 |
#### Moved-from state of library types <a id="lib.types.movedfrom">[[lib.types.movedfrom]]</a>
|
| 262 |
|
| 263 |
Objects of types defined in the C++ standard library may be moved from
|
| 264 |
[[class.copy.ctor]]. Move operations may be explicitly specified or
|
| 265 |
implicitly generated. Unless otherwise specified, such moved-from
|
| 266 |
-
objects shall be placed in a valid but unspecified state
|
|
|
|
| 267 |
|
| 268 |
An object of a type defined in the C++ standard library may be
|
| 269 |
move-assigned [[class.copy.assign]] to itself. Unless otherwise
|
| 270 |
specified, such an assignment places the object in a valid but
|
| 271 |
unspecified state.
|
| 272 |
|
| 273 |
<!-- Link reference definitions -->
|
| 274 |
[alg.c.library]: algorithms.md#alg.c.library
|
|
|
|
| 275 |
[alg.sorting]: algorithms.md#alg.sorting
|
| 276 |
[algorithm.stable]: #algorithm.stable
|
| 277 |
[algorithms]: algorithms.md#algorithms
|
| 278 |
[algorithms.requirements]: algorithms.md#algorithms.requirements
|
| 279 |
[alloc.errors]: support.md#alloc.errors
|
| 280 |
[allocator.requirements]: #allocator.requirements
|
| 281 |
[allocator.requirements.completeness]: #allocator.requirements.completeness
|
| 282 |
[allocator.requirements.general]: #allocator.requirements.general
|
| 283 |
[allocator.traits]: mem.md#allocator.traits
|
| 284 |
[alt.headers]: #alt.headers
|
|
|
|
| 285 |
[array.creation]: containers.md#array.creation
|
| 286 |
[atomics]: thread.md#atomics
|
| 287 |
[bad.alloc]: support.md#bad.alloc
|
|
|
|
|
|
|
| 288 |
[basic.def.odr]: basic.md#basic.def.odr
|
| 289 |
[basic.fundamental]: basic.md#basic.fundamental
|
|
|
|
| 290 |
[basic.life]: basic.md#basic.life
|
| 291 |
[basic.link]: basic.md#basic.link
|
| 292 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 293 |
[basic.lookup.qual]: basic.md#basic.lookup.qual
|
| 294 |
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 295 |
[basic.scope.namespace]: basic.md#basic.scope.namespace
|
| 296 |
-
[basic.start]: basic.md#basic.start
|
| 297 |
[basic.stc.dynamic]: basic.md#basic.stc.dynamic
|
| 298 |
[bit]: utilities.md#bit
|
| 299 |
[bitmask.types]: #bitmask.types
|
| 300 |
[byte.strings]: #byte.strings
|
| 301 |
[c.annex.k.names]: #c.annex.k.names
|
|
|
|
|
|
|
| 302 |
[cassert.syn]: diagnostics.md#cassert.syn
|
| 303 |
[cerrno.syn]: diagnostics.md#cerrno.syn
|
| 304 |
[character.seq]: #character.seq
|
| 305 |
[character.seq.general]: #character.seq.general
|
|
|
|
| 306 |
[class.copy.assign]: class.md#class.copy.assign
|
| 307 |
[class.copy.ctor]: class.md#class.copy.ctor
|
| 308 |
[class.dtor]: class.md#class.dtor
|
| 309 |
[class.mem]: class.md#class.mem
|
|
|
|
| 310 |
[class.virtual]: class.md#class.virtual
|
| 311 |
-
[clocale.syn]:
|
| 312 |
[cmp]: support.md#cmp
|
| 313 |
[compliance]: #compliance
|
| 314 |
[concept.destructible]: concepts.md#concept.destructible
|
| 315 |
[concept.invocable]: concepts.md#concept.invocable
|
| 316 |
[concept.totallyordered]: concepts.md#concept.totallyordered
|
|
@@ -328,40 +368,51 @@ unspecified state.
|
|
| 328 |
[conv]: expr.md#conv
|
| 329 |
[conv.func]: expr.md#conv.func
|
| 330 |
[conventions]: #conventions
|
| 331 |
[conventions.general]: #conventions.general
|
| 332 |
[cpp.include]: cpp.md#cpp.include
|
| 333 |
-
[cpp.replace]: cpp.md#cpp.replace
|
| 334 |
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 335 |
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 336 |
[cpp17.destructible]: #cpp17.destructible
|
| 337 |
[cpp17.hash]: #cpp17.hash
|
| 338 |
[cpp17.moveassignable]: #cpp17.moveassignable
|
| 339 |
[cpp17.nullablepointer]: #cpp17.nullablepointer
|
| 340 |
[cstdarg.syn]: support.md#cstdarg.syn
|
| 341 |
[cstddef.syn]: support.md#cstddef.syn
|
| 342 |
[cstdint.syn]: support.md#cstdint.syn
|
|
|
|
| 343 |
[customization.point.object]: #customization.point.object
|
| 344 |
[dcl.array]: dcl.md#dcl.array
|
| 345 |
-
[dcl.attr]: dcl.md#dcl.attr
|
| 346 |
[dcl.constexpr]: dcl.md#dcl.constexpr
|
|
|
|
|
|
|
| 347 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 348 |
[dcl.init]: dcl.md#dcl.init
|
| 349 |
[dcl.inline]: dcl.md#dcl.inline
|
| 350 |
[dcl.link]: dcl.md#dcl.link
|
| 351 |
[dcl.pre]: dcl.md#dcl.pre
|
| 352 |
[dcl.typedef]: dcl.md#dcl.typedef
|
|
|
|
|
|
|
| 353 |
[defns.nonconst.libcall]: intro.md#defns.nonconst.libcall
|
|
|
|
| 354 |
[depr]: future.md#depr
|
| 355 |
[derivation]: #derivation
|
| 356 |
[derived.classes]: #derived.classes
|
| 357 |
[description]: #description
|
| 358 |
[description.general]: #description.general
|
| 359 |
[diagnostics]: diagnostics.md#diagnostics
|
| 360 |
[enumerated.types]: #enumerated.types
|
|
|
|
| 361 |
[except]: except.md#except
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
[expos.only.entity]: #expos.only.entity
|
|
|
|
| 363 |
[expr.delete]: expr.md#expr.delete
|
| 364 |
[expr.new]: expr.md#expr.new
|
| 365 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 366 |
[extern.names]: #extern.names
|
| 367 |
[extern.types]: #extern.types
|
|
@@ -374,28 +425,29 @@ unspecified state.
|
|
| 374 |
[headers]: #headers
|
| 375 |
[headers.cpp]: #headers.cpp
|
| 376 |
[headers.cpp.c]: #headers.cpp.c
|
| 377 |
[headers.cpp.fs]: #headers.cpp.fs
|
| 378 |
[hidden.friends]: #hidden.friends
|
|
|
|
| 379 |
[input.output]: input.md#input.output
|
| 380 |
[intro.compliance]: intro.md#intro.compliance
|
| 381 |
[intro.multithread]: basic.md#intro.multithread
|
|
|
|
| 382 |
[intro.refs]: intro.md#intro.refs
|
| 383 |
[iterator.requirements]: iterators.md#iterator.requirements
|
| 384 |
[iterators]: iterators.md#iterators
|
| 385 |
[lex.charset]: lex.md#lex.charset
|
| 386 |
[lex.name]: lex.md#lex.name
|
| 387 |
-
[lex.name.special]: #lex.name.special
|
| 388 |
[lex.phases]: lex.md#lex.phases
|
| 389 |
[lex.separate]: lex.md#lex.separate
|
| 390 |
[lib.types.movedfrom]: #lib.types.movedfrom
|
| 391 |
[library]: #library
|
| 392 |
[library.c]: #library.c
|
| 393 |
[library.categories]: #library.categories
|
|
|
|
| 394 |
[library.general]: #library.general
|
| 395 |
-
[locales]:
|
| 396 |
-
[localization]: localization.md#localization
|
| 397 |
[macro.names]: #macro.names
|
| 398 |
[mem]: mem.md#mem
|
| 399 |
[member.functions]: #member.functions
|
| 400 |
[memory]: mem.md#memory
|
| 401 |
[meta]: meta.md#meta
|
|
@@ -405,32 +457,34 @@ unspecified state.
|
|
| 405 |
[namespace.def]: dcl.md#namespace.def
|
| 406 |
[namespace.future]: #namespace.future
|
| 407 |
[namespace.posix]: #namespace.posix
|
| 408 |
[namespace.std]: #namespace.std
|
| 409 |
[namespace.udecl]: dcl.md#namespace.udecl
|
| 410 |
-
[new.delete]: support.md#new.delete
|
| 411 |
[new.handler]: support.md#new.handler
|
| 412 |
-
[new.syn]: support.md#new.syn
|
| 413 |
[nullablepointer.requirements]: #nullablepointer.requirements
|
| 414 |
[numeric.requirements]: numerics.md#numeric.requirements
|
| 415 |
[numerics]: numerics.md#numerics
|
|
|
|
| 416 |
[objects.within.classes]: #objects.within.classes
|
|
|
|
| 417 |
[organization]: #organization
|
| 418 |
[organization.general]: #organization.general
|
| 419 |
[ostream.iterator.ops]: iterators.md#ostream.iterator.ops
|
| 420 |
[over.literal]: over.md#over.literal
|
| 421 |
[over.match]: over.md#over.match
|
| 422 |
[over.match.oper]: over.md#over.match.oper
|
| 423 |
[protection.within.classes]: #protection.within.classes
|
|
|
|
| 424 |
[random.access.iterators]: iterators.md#random.access.iterators
|
| 425 |
[ranges]: ranges.md#ranges
|
| 426 |
[ratio]: meta.md#ratio
|
| 427 |
-
[re]:
|
| 428 |
[reentrancy]: #reentrancy
|
| 429 |
[replacement.functions]: #replacement.functions
|
| 430 |
[requirements]: #requirements
|
| 431 |
[requirements.general]: #requirements.general
|
|
|
|
| 432 |
[res.on.arguments]: #res.on.arguments
|
| 433 |
[res.on.data.races]: #res.on.data.races
|
| 434 |
[res.on.exception.handling]: #res.on.exception.handling
|
| 435 |
[res.on.functions]: #res.on.functions
|
| 436 |
[res.on.headers]: #res.on.headers
|
|
@@ -440,31 +494,34 @@ unspecified state.
|
|
| 440 |
[reserved.names]: #reserved.names
|
| 441 |
[reserved.names.general]: #reserved.names.general
|
| 442 |
[specialized.addressof]: mem.md#specialized.addressof
|
| 443 |
[std.exceptions]: diagnostics.md#std.exceptions
|
| 444 |
[std.modules]: #std.modules
|
|
|
|
| 445 |
[stmt.return]: stmt.md#stmt.return
|
| 446 |
[stream.types]: input.md#stream.types
|
|
|
|
|
|
|
| 447 |
[strings]: strings.md#strings
|
| 448 |
[structure]: #structure
|
| 449 |
[structure.elements]: #structure.elements
|
| 450 |
[structure.requirements]: #structure.requirements
|
| 451 |
[structure.see.also]: #structure.see.also
|
| 452 |
[structure.specifications]: #structure.specifications
|
| 453 |
[structure.summary]: #structure.summary
|
| 454 |
[support]: support.md#support
|
| 455 |
[support.c.headers]: support.md#support.c.headers
|
| 456 |
[support.c.headers.other]: support.md#support.c.headers.other
|
|
|
|
| 457 |
[support.coroutine]: support.md#support.coroutine
|
| 458 |
[support.dynamic]: support.md#support.dynamic
|
| 459 |
[support.exception]: support.md#support.exception
|
| 460 |
[support.initlist]: support.md#support.initlist
|
| 461 |
[support.limits]: support.md#support.limits
|
| 462 |
[support.rtti]: support.md#support.rtti
|
| 463 |
[support.runtime]: support.md#support.runtime
|
| 464 |
[support.srcloc]: support.md#support.srcloc
|
| 465 |
-
[support.start.term]: support.md#support.start.term
|
| 466 |
[support.types]: support.md#support.types
|
| 467 |
[swappable.requirements]: #swappable.requirements
|
| 468 |
[syserr]: diagnostics.md#syserr
|
| 469 |
[syserr.errcode.overview]: diagnostics.md#syserr.errcode.overview
|
| 470 |
[tab:cpp17.destructible]: #tab:cpp17.destructible
|
|
@@ -474,11 +531,13 @@ unspecified state.
|
|
| 474 |
[temp.constr.decl]: temp.md#temp.constr.decl
|
| 475 |
[temp.deduct.call]: temp.md#temp.deduct.call
|
| 476 |
[template.bitset]: utilities.md#template.bitset
|
| 477 |
[term.incomplete.type]: basic.md#term.incomplete.type
|
| 478 |
[term.object.type]: basic.md#term.object.type
|
|
|
|
| 479 |
[terminate.handler]: support.md#terminate.handler
|
|
|
|
| 480 |
[thread]: thread.md#thread
|
| 481 |
[time]: time.md#time
|
| 482 |
[tuple]: utilities.md#tuple
|
| 483 |
[type.descriptions]: #type.descriptions
|
| 484 |
[type.descriptions.general]: #type.descriptions.general
|
|
@@ -492,13 +551,20 @@ unspecified state.
|
|
| 492 |
[utility]: utilities.md#utility
|
| 493 |
[utility.arg.requirements]: #utility.arg.requirements
|
| 494 |
[utility.requirements]: #utility.requirements
|
| 495 |
[utility.requirements.general]: #utility.requirements.general
|
| 496 |
[value.error.codes]: #value.error.codes
|
|
|
|
|
|
|
|
|
|
| 497 |
[zombie.names]: #zombie.names
|
|
|
|
|
|
|
|
|
|
|
|
|
| 498 |
|
| 499 |
-
[^1]: See also ISO/IEC 9899:2018
|
| 500 |
|
| 501 |
[^2]: To save space, items that do not apply to a Clause are omitted.
|
| 502 |
For example, if a Clause does not specify any requirements, there
|
| 503 |
will be no “Requirements” subclause.
|
| 504 |
|
|
@@ -567,11 +633,12 @@ unspecified state.
|
|
| 567 |
|
| 568 |
[^19]: This is the same as the C standard library.
|
| 569 |
|
| 570 |
[^20]: The only reliable way to declare an object or function signature
|
| 571 |
from the C standard library is by including the header that declares
|
| 572 |
-
it, notwithstanding the latitude granted in
|
|
|
|
| 573 |
|
| 574 |
[^21]: Any library code that instantiates other library templates must
|
| 575 |
be prepared to work adequately with any user-supplied specialization
|
| 576 |
that meets the minimum requirements of this document.
|
| 577 |
|
|
@@ -590,12 +657,12 @@ unspecified state.
|
|
| 590 |
|
| 591 |
[^25]: A valid C++ program always calls the expected library non-member
|
| 592 |
function. An implementation can also define additional non-member
|
| 593 |
functions that would otherwise not be called by a valid C++ program.
|
| 594 |
|
| 595 |
-
[^26]: That is, the C library functions can all be treated as
|
| 596 |
-
are marked `noexcept`. This allows implementations to make
|
| 597 |
performance optimizations based on the absence of exceptions at
|
| 598 |
runtime.
|
| 599 |
|
| 600 |
[^27]: The functions `qsort()` and `bsearch()` [[alg.c.library]] meet
|
| 601 |
this condition.
|
|
|
|
| 3 |
#### Overview <a id="conforming.overview">[[conforming.overview]]</a>
|
| 4 |
|
| 5 |
Subclause [[conforming]] describes the constraints upon, and latitude
|
| 6 |
of, implementations of the C++ standard library.
|
| 7 |
|
| 8 |
+
An implementation’s use of
|
| 9 |
+
|
| 10 |
+
- headers is discussed in [[res.on.headers]],
|
| 11 |
+
- macros in [[res.on.macro.definitions]],
|
| 12 |
+
- non-member functions in [[global.functions]],
|
| 13 |
+
- member functions in [[member.functions]],
|
| 14 |
+
- data race avoidance in [[res.on.data.races]],
|
| 15 |
+
- access specifiers in [[protection.within.classes]],
|
| 16 |
+
- class derivation in [[derivation]],
|
| 17 |
+
- exceptions in [[res.on.exception.handling]], and
|
| 18 |
+
- contract assertions in [[res.contract.assertions]].
|
| 19 |
|
| 20 |
#### Headers <a id="res.on.headers">[[res.on.headers]]</a>
|
| 21 |
|
| 22 |
A C++ header may include other C++ headers. A C++ header shall provide
|
| 23 |
the declarations and definitions that appear in its synopsis. A C++
|
|
|
|
| 47 |
|
| 48 |
It is unspecified whether any non-member functions in the C++ standard
|
| 49 |
library are defined as inline [[dcl.inline]].
|
| 50 |
|
| 51 |
A call to a non-member function signature described in [[support]]
|
| 52 |
+
through [[exec]] and [[depr]] shall behave as if the implementation
|
| 53 |
declared no additional non-member function signatures.[^25]
|
| 54 |
|
| 55 |
An implementation shall not declare a non-member function signature with
|
| 56 |
additional default arguments.
|
| 57 |
|
|
|
|
| 99 |
Whenever this document specifies a friend declaration of a function or
|
| 100 |
function template within a class or class template definition, that
|
| 101 |
declaration shall be the only declaration of that function or function
|
| 102 |
template provided by an implementation.
|
| 103 |
|
| 104 |
+
[*Note 1*: In particular, a conforming implementation does not provide
|
| 105 |
+
any additional declarations of that function or function template at
|
| 106 |
namespace scope. — *end note*]
|
| 107 |
|
| 108 |
[*Note 2*: Such a friend function or function template declaration is
|
| 109 |
known as a hidden friend, as it is visible neither to ordinary
|
| 110 |
unqualified lookup [[basic.lookup.unqual]] nor to qualified lookup
|
|
|
|
| 114 |
|
| 115 |
This document explicitly requires that certain standard library
|
| 116 |
functions are `constexpr` [[dcl.constexpr]]. An implementation shall not
|
| 117 |
declare any standard library function signature as `constexpr` except
|
| 118 |
for those where it is explicitly required. Within any header that
|
| 119 |
+
provides any non-defining declarations of constexpr functions an
|
| 120 |
+
implementation shall provide corresponding definitions.
|
| 121 |
|
| 122 |
#### Requirements for stable algorithms <a id="algorithm.stable">[[algorithm.stable]]</a>
|
| 123 |
|
| 124 |
When the requirements for an algorithm state that it is “stable” without
|
| 125 |
further elaboration, it means:
|
|
|
|
| 184 |
effects that are visible [[intro.multithread]] to users.
|
| 185 |
|
| 186 |
[*Note 3*: This allows implementations to parallelize operations if
|
| 187 |
there are no visible side effects. — *end note*]
|
| 188 |
|
| 189 |
+
#### Properties of library classes <a id="library.class.props">[[library.class.props]]</a>
|
| 190 |
+
|
| 191 |
+
Unless explicitly stated otherwise, it is unspecified whether any class
|
| 192 |
+
described in [[support]] through [[exec]] and [[depr]] is a trivially
|
| 193 |
+
copyable class, a standard-layout class, or an implicit-lifetime class
|
| 194 |
+
[[class.prop]].
|
| 195 |
+
|
| 196 |
+
Unless explicitly stated otherwise, it is unspecified whether any class
|
| 197 |
+
for which trivial relocation (i.e., the effects of `trivially_relocate`
|
| 198 |
+
[[obj.lifetime]]) would be semantically equivalent to move-construction
|
| 199 |
+
of the destination object followed by destruction of the source object
|
| 200 |
+
is a trivially relocatable class [[class.prop]].
|
| 201 |
+
|
| 202 |
+
Unless explicitly stated otherwise, it is unspecified whether a class
|
| 203 |
+
`C` is a replaceable class [[class.prop]] if assigning an xvalue `a` of
|
| 204 |
+
type `C` to an object `b` of type `C` is semantically equivalent to
|
| 205 |
+
destroying `b` and then constructing from `a` in `b`’s place.
|
| 206 |
+
|
| 207 |
#### Protection within classes <a id="protection.within.classes">[[protection.within.classes]]</a>
|
| 208 |
|
| 209 |
It is unspecified whether any function signature or class described in
|
| 210 |
+
[[support]] through [[exec]] and [[depr]] is a friend of another class
|
| 211 |
in the C++ standard library.
|
| 212 |
|
| 213 |
#### Derived classes <a id="derivation">[[derivation]]</a>
|
| 214 |
|
| 215 |
An implementation may derive any class in the C++ standard library from
|
|
|
|
| 237 |
#### Restrictions on exception handling <a id="res.on.exception.handling">[[res.on.exception.handling]]</a>
|
| 238 |
|
| 239 |
Any of the functions defined in the C++ standard library can report a
|
| 240 |
failure by throwing an exception of a type described in its *Throws:*
|
| 241 |
paragraph, or of a type derived from a type named in the *Throws:*
|
| 242 |
+
paragraph that would be caught by a *handler* [[except.handle]] for the
|
| 243 |
+
base type.
|
| 244 |
|
| 245 |
Functions from the C standard library shall not throw exceptions [^26]
|
| 246 |
|
| 247 |
except when such a function calls a program-supplied function that
|
| 248 |
throws an exception.[^27]
|
| 249 |
|
| 250 |
Destructor operations defined in the C++ standard library shall not
|
| 251 |
throw exceptions. Every destructor in the C++ standard library shall
|
| 252 |
+
behave as if it had a non-throwing exception specification
|
| 253 |
+
[[except.spec]].
|
| 254 |
|
| 255 |
Functions defined in the C++ standard library that do not have a
|
| 256 |
*Throws:* paragraph but do have a potentially-throwing exception
|
| 257 |
specification may throw *implementation-defined* exceptions.[^28]
|
| 258 |
|
|
|
|
| 261 |
[[bad.alloc]], [[support.exception]], [[std.exceptions]].
|
| 262 |
|
| 263 |
An implementation may strengthen the exception specification for a
|
| 264 |
non-virtual function by adding a non-throwing exception specification.
|
| 265 |
|
| 266 |
+
#### Contract assertions <a id="res.contract.assertions">[[res.contract.assertions]]</a>
|
| 267 |
+
|
| 268 |
+
Unless specified otherwise, an implementation may check the specified
|
| 269 |
+
preconditions and postconditions of a function in the C++ standard
|
| 270 |
+
library using contract assertions
|
| 271 |
+
[[basic.contract]], [[structure.specifications]].
|
| 272 |
+
|
| 273 |
#### Value of error codes <a id="value.error.codes">[[value.error.codes]]</a>
|
| 274 |
|
| 275 |
Certain functions in the C++ standard library report errors via a
|
| 276 |
+
`error_code` [[syserr.errcode.overview]] object. That object’s
|
| 277 |
+
`category()` member shall return `system_category()` for errors
|
| 278 |
originating from the operating system, or a reference to an
|
| 279 |
*implementation-defined* `error_category` object for errors originating
|
| 280 |
elsewhere. The implementation shall define the possible values of
|
| 281 |
`value()` for each of these error categories.
|
| 282 |
|
|
|
|
| 292 |
#### Moved-from state of library types <a id="lib.types.movedfrom">[[lib.types.movedfrom]]</a>
|
| 293 |
|
| 294 |
Objects of types defined in the C++ standard library may be moved from
|
| 295 |
[[class.copy.ctor]]. Move operations may be explicitly specified or
|
| 296 |
implicitly generated. Unless otherwise specified, such moved-from
|
| 297 |
+
objects shall be placed in a valid but unspecified state
|
| 298 |
+
[[defns.valid]].
|
| 299 |
|
| 300 |
An object of a type defined in the C++ standard library may be
|
| 301 |
move-assigned [[class.copy.assign]] to itself. Unless otherwise
|
| 302 |
specified, such an assignment places the object in a valid but
|
| 303 |
unspecified state.
|
| 304 |
|
| 305 |
<!-- Link reference definitions -->
|
| 306 |
[alg.c.library]: algorithms.md#alg.c.library
|
| 307 |
+
[alg.func.obj]: #alg.func.obj
|
| 308 |
[alg.sorting]: algorithms.md#alg.sorting
|
| 309 |
[algorithm.stable]: #algorithm.stable
|
| 310 |
[algorithms]: algorithms.md#algorithms
|
| 311 |
[algorithms.requirements]: algorithms.md#algorithms.requirements
|
| 312 |
[alloc.errors]: support.md#alloc.errors
|
| 313 |
[allocator.requirements]: #allocator.requirements
|
| 314 |
[allocator.requirements.completeness]: #allocator.requirements.completeness
|
| 315 |
[allocator.requirements.general]: #allocator.requirements.general
|
| 316 |
[allocator.traits]: mem.md#allocator.traits
|
| 317 |
[alt.headers]: #alt.headers
|
| 318 |
+
[array]: containers.md#array
|
| 319 |
[array.creation]: containers.md#array.creation
|
| 320 |
[atomics]: thread.md#atomics
|
| 321 |
[bad.alloc]: support.md#bad.alloc
|
| 322 |
+
[basic.contract]: basic.md#basic.contract
|
| 323 |
+
[basic.contract.eval]: basic.md#basic.contract.eval
|
| 324 |
[basic.def.odr]: basic.md#basic.def.odr
|
| 325 |
[basic.fundamental]: basic.md#basic.fundamental
|
| 326 |
+
[basic.indet]: basic.md#basic.indet
|
| 327 |
[basic.life]: basic.md#basic.life
|
| 328 |
[basic.link]: basic.md#basic.link
|
| 329 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 330 |
[basic.lookup.qual]: basic.md#basic.lookup.qual
|
| 331 |
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 332 |
[basic.scope.namespace]: basic.md#basic.scope.namespace
|
|
|
|
| 333 |
[basic.stc.dynamic]: basic.md#basic.stc.dynamic
|
| 334 |
[bit]: utilities.md#bit
|
| 335 |
[bitmask.types]: #bitmask.types
|
| 336 |
[byte.strings]: #byte.strings
|
| 337 |
[c.annex.k.names]: #c.annex.k.names
|
| 338 |
+
[c.math]: numerics.md#c.math
|
| 339 |
+
[c.strings]: strings.md#c.strings
|
| 340 |
[cassert.syn]: diagnostics.md#cassert.syn
|
| 341 |
[cerrno.syn]: diagnostics.md#cerrno.syn
|
| 342 |
[character.seq]: #character.seq
|
| 343 |
[character.seq.general]: #character.seq.general
|
| 344 |
+
[charconv]: text.md#charconv
|
| 345 |
[class.copy.assign]: class.md#class.copy.assign
|
| 346 |
[class.copy.ctor]: class.md#class.copy.ctor
|
| 347 |
[class.dtor]: class.md#class.dtor
|
| 348 |
[class.mem]: class.md#class.mem
|
| 349 |
+
[class.prop]: class.md#class.prop
|
| 350 |
[class.virtual]: class.md#class.virtual
|
| 351 |
+
[clocale.syn]: text.md#clocale.syn
|
| 352 |
[cmp]: support.md#cmp
|
| 353 |
[compliance]: #compliance
|
| 354 |
[concept.destructible]: concepts.md#concept.destructible
|
| 355 |
[concept.invocable]: concepts.md#concept.invocable
|
| 356 |
[concept.totallyordered]: concepts.md#concept.totallyordered
|
|
|
|
| 368 |
[conv]: expr.md#conv
|
| 369 |
[conv.func]: expr.md#conv.func
|
| 370 |
[conventions]: #conventions
|
| 371 |
[conventions.general]: #conventions.general
|
| 372 |
[cpp.include]: cpp.md#cpp.include
|
|
|
|
| 373 |
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 374 |
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 375 |
[cpp17.destructible]: #cpp17.destructible
|
| 376 |
[cpp17.hash]: #cpp17.hash
|
| 377 |
[cpp17.moveassignable]: #cpp17.moveassignable
|
| 378 |
[cpp17.nullablepointer]: #cpp17.nullablepointer
|
| 379 |
[cstdarg.syn]: support.md#cstdarg.syn
|
| 380 |
[cstddef.syn]: support.md#cstddef.syn
|
| 381 |
[cstdint.syn]: support.md#cstdint.syn
|
| 382 |
+
[cstdlib.syn]: support.md#cstdlib.syn
|
| 383 |
[customization.point.object]: #customization.point.object
|
| 384 |
[dcl.array]: dcl.md#dcl.array
|
|
|
|
| 385 |
[dcl.constexpr]: dcl.md#dcl.constexpr
|
| 386 |
+
[dcl.contract.func]: dcl.md#dcl.contract.func
|
| 387 |
+
[dcl.fct.def.delete]: dcl.md#dcl.fct.def.delete
|
| 388 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 389 |
[dcl.init]: dcl.md#dcl.init
|
| 390 |
[dcl.inline]: dcl.md#dcl.inline
|
| 391 |
[dcl.link]: dcl.md#dcl.link
|
| 392 |
[dcl.pre]: dcl.md#dcl.pre
|
| 393 |
[dcl.typedef]: dcl.md#dcl.typedef
|
| 394 |
+
[debugging]: diagnostics.md#debugging
|
| 395 |
+
[defns.const.subexpr]: intro.md#defns.const.subexpr
|
| 396 |
[defns.nonconst.libcall]: intro.md#defns.nonconst.libcall
|
| 397 |
+
[defns.valid]: intro.md#defns.valid
|
| 398 |
[depr]: future.md#depr
|
| 399 |
[derivation]: #derivation
|
| 400 |
[derived.classes]: #derived.classes
|
| 401 |
[description]: #description
|
| 402 |
[description.general]: #description.general
|
| 403 |
[diagnostics]: diagnostics.md#diagnostics
|
| 404 |
[enumerated.types]: #enumerated.types
|
| 405 |
+
[errno]: diagnostics.md#errno
|
| 406 |
[except]: except.md#except
|
| 407 |
+
[except.handle]: except.md#except.handle
|
| 408 |
+
[except.spec]: except.md#except.spec
|
| 409 |
+
[exec]: exec.md#exec
|
| 410 |
+
[execpol]: algorithms.md#execpol
|
| 411 |
+
[expected]: utilities.md#expected
|
| 412 |
[expos.only.entity]: #expos.only.entity
|
| 413 |
+
[expr.call]: expr.md#expr.call
|
| 414 |
[expr.delete]: expr.md#expr.delete
|
| 415 |
[expr.new]: expr.md#expr.new
|
| 416 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 417 |
[extern.names]: #extern.names
|
| 418 |
[extern.types]: #extern.types
|
|
|
|
| 425 |
[headers]: #headers
|
| 426 |
[headers.cpp]: #headers.cpp
|
| 427 |
[headers.cpp.c]: #headers.cpp.c
|
| 428 |
[headers.cpp.fs]: #headers.cpp.fs
|
| 429 |
[hidden.friends]: #hidden.friends
|
| 430 |
+
[inplace.vector]: containers.md#inplace.vector
|
| 431 |
[input.output]: input.md#input.output
|
| 432 |
[intro.compliance]: intro.md#intro.compliance
|
| 433 |
[intro.multithread]: basic.md#intro.multithread
|
| 434 |
+
[intro.races]: basic.md#intro.races
|
| 435 |
[intro.refs]: intro.md#intro.refs
|
| 436 |
[iterator.requirements]: iterators.md#iterator.requirements
|
| 437 |
[iterators]: iterators.md#iterators
|
| 438 |
[lex.charset]: lex.md#lex.charset
|
| 439 |
[lex.name]: lex.md#lex.name
|
|
|
|
| 440 |
[lex.phases]: lex.md#lex.phases
|
| 441 |
[lex.separate]: lex.md#lex.separate
|
| 442 |
[lib.types.movedfrom]: #lib.types.movedfrom
|
| 443 |
[library]: #library
|
| 444 |
[library.c]: #library.c
|
| 445 |
[library.categories]: #library.categories
|
| 446 |
+
[library.class.props]: #library.class.props
|
| 447 |
[library.general]: #library.general
|
| 448 |
+
[locales]: text.md#locales
|
|
|
|
| 449 |
[macro.names]: #macro.names
|
| 450 |
[mem]: mem.md#mem
|
| 451 |
[member.functions]: #member.functions
|
| 452 |
[memory]: mem.md#memory
|
| 453 |
[meta]: meta.md#meta
|
|
|
|
| 457 |
[namespace.def]: dcl.md#namespace.def
|
| 458 |
[namespace.future]: #namespace.future
|
| 459 |
[namespace.posix]: #namespace.posix
|
| 460 |
[namespace.std]: #namespace.std
|
| 461 |
[namespace.udecl]: dcl.md#namespace.udecl
|
|
|
|
| 462 |
[new.handler]: support.md#new.handler
|
|
|
|
| 463 |
[nullablepointer.requirements]: #nullablepointer.requirements
|
| 464 |
[numeric.requirements]: numerics.md#numeric.requirements
|
| 465 |
[numerics]: numerics.md#numerics
|
| 466 |
+
[obj.lifetime]: mem.md#obj.lifetime
|
| 467 |
[objects.within.classes]: #objects.within.classes
|
| 468 |
+
[optional]: utilities.md#optional
|
| 469 |
[organization]: #organization
|
| 470 |
[organization.general]: #organization.general
|
| 471 |
[ostream.iterator.ops]: iterators.md#ostream.iterator.ops
|
| 472 |
[over.literal]: over.md#over.literal
|
| 473 |
[over.match]: over.md#over.match
|
| 474 |
[over.match.oper]: over.md#over.match.oper
|
| 475 |
[protection.within.classes]: #protection.within.classes
|
| 476 |
+
[rand]: numerics.md#rand
|
| 477 |
[random.access.iterators]: iterators.md#random.access.iterators
|
| 478 |
[ranges]: ranges.md#ranges
|
| 479 |
[ratio]: meta.md#ratio
|
| 480 |
+
[re]: text.md#re
|
| 481 |
[reentrancy]: #reentrancy
|
| 482 |
[replacement.functions]: #replacement.functions
|
| 483 |
[requirements]: #requirements
|
| 484 |
[requirements.general]: #requirements.general
|
| 485 |
+
[res.contract.assertions]: #res.contract.assertions
|
| 486 |
[res.on.arguments]: #res.on.arguments
|
| 487 |
[res.on.data.races]: #res.on.data.races
|
| 488 |
[res.on.exception.handling]: #res.on.exception.handling
|
| 489 |
[res.on.functions]: #res.on.functions
|
| 490 |
[res.on.headers]: #res.on.headers
|
|
|
|
| 494 |
[reserved.names]: #reserved.names
|
| 495 |
[reserved.names.general]: #reserved.names.general
|
| 496 |
[specialized.addressof]: mem.md#specialized.addressof
|
| 497 |
[std.exceptions]: diagnostics.md#std.exceptions
|
| 498 |
[std.modules]: #std.modules
|
| 499 |
+
[stdbit.h.syn]: utilities.md#stdbit.h.syn
|
| 500 |
[stmt.return]: stmt.md#stmt.return
|
| 501 |
[stream.types]: input.md#stream.types
|
| 502 |
+
[string.classes]: strings.md#string.classes
|
| 503 |
+
[string.view]: strings.md#string.view
|
| 504 |
[strings]: strings.md#strings
|
| 505 |
[structure]: #structure
|
| 506 |
[structure.elements]: #structure.elements
|
| 507 |
[structure.requirements]: #structure.requirements
|
| 508 |
[structure.see.also]: #structure.see.also
|
| 509 |
[structure.specifications]: #structure.specifications
|
| 510 |
[structure.summary]: #structure.summary
|
| 511 |
[support]: support.md#support
|
| 512 |
[support.c.headers]: support.md#support.c.headers
|
| 513 |
[support.c.headers.other]: support.md#support.c.headers.other
|
| 514 |
+
[support.contract]: support.md#support.contract
|
| 515 |
[support.coroutine]: support.md#support.coroutine
|
| 516 |
[support.dynamic]: support.md#support.dynamic
|
| 517 |
[support.exception]: support.md#support.exception
|
| 518 |
[support.initlist]: support.md#support.initlist
|
| 519 |
[support.limits]: support.md#support.limits
|
| 520 |
[support.rtti]: support.md#support.rtti
|
| 521 |
[support.runtime]: support.md#support.runtime
|
| 522 |
[support.srcloc]: support.md#support.srcloc
|
|
|
|
| 523 |
[support.types]: support.md#support.types
|
| 524 |
[swappable.requirements]: #swappable.requirements
|
| 525 |
[syserr]: diagnostics.md#syserr
|
| 526 |
[syserr.errcode.overview]: diagnostics.md#syserr.errcode.overview
|
| 527 |
[tab:cpp17.destructible]: #tab:cpp17.destructible
|
|
|
|
| 531 |
[temp.constr.decl]: temp.md#temp.constr.decl
|
| 532 |
[temp.deduct.call]: temp.md#temp.deduct.call
|
| 533 |
[template.bitset]: utilities.md#template.bitset
|
| 534 |
[term.incomplete.type]: basic.md#term.incomplete.type
|
| 535 |
[term.object.type]: basic.md#term.object.type
|
| 536 |
+
[term.replaceable.function]: dcl.md#term.replaceable.function
|
| 537 |
[terminate.handler]: support.md#terminate.handler
|
| 538 |
+
[text]: text.md#text
|
| 539 |
[thread]: thread.md#thread
|
| 540 |
[time]: time.md#time
|
| 541 |
[tuple]: utilities.md#tuple
|
| 542 |
[type.descriptions]: #type.descriptions
|
| 543 |
[type.descriptions.general]: #type.descriptions.general
|
|
|
|
| 551 |
[utility]: utilities.md#utility
|
| 552 |
[utility.arg.requirements]: #utility.arg.requirements
|
| 553 |
[utility.requirements]: #utility.requirements
|
| 554 |
[utility.requirements.general]: #utility.requirements.general
|
| 555 |
[value.error.codes]: #value.error.codes
|
| 556 |
+
[variant]: utilities.md#variant
|
| 557 |
+
[views.contiguous]: containers.md#views.contiguous
|
| 558 |
+
[views.multidim]: containers.md#views.multidim
|
| 559 |
[zombie.names]: #zombie.names
|
| 560 |
+
[zombie.names.fnmacro]: #zombie.names.fnmacro
|
| 561 |
+
[zombie.names.header]: #zombie.names.header
|
| 562 |
+
[zombie.names.objmacro]: #zombie.names.objmacro
|
| 563 |
+
[zombie.names.std]: #zombie.names.std
|
| 564 |
|
| 565 |
+
[^1]: See also ISO/IEC 9899:2018 (C), 7.6.
|
| 566 |
|
| 567 |
[^2]: To save space, items that do not apply to a Clause are omitted.
|
| 568 |
For example, if a Clause does not specify any requirements, there
|
| 569 |
will be no “Requirements” subclause.
|
| 570 |
|
|
|
|
| 633 |
|
| 634 |
[^19]: This is the same as the C standard library.
|
| 635 |
|
| 636 |
[^20]: The only reliable way to declare an object or function signature
|
| 637 |
from the C standard library is by including the header that declares
|
| 638 |
+
it, notwithstanding the latitude granted in ISO/IEC 9899:2018 (C),
|
| 639 |
+
7.1.4.
|
| 640 |
|
| 641 |
[^21]: Any library code that instantiates other library templates must
|
| 642 |
be prepared to work adequately with any user-supplied specialization
|
| 643 |
that meets the minimum requirements of this document.
|
| 644 |
|
|
|
|
| 657 |
|
| 658 |
[^25]: A valid C++ program always calls the expected library non-member
|
| 659 |
function. An implementation can also define additional non-member
|
| 660 |
functions that would otherwise not be called by a valid C++ program.
|
| 661 |
|
| 662 |
+
[^26]: That is, the C standard library functions can all be treated as
|
| 663 |
+
if they are marked `noexcept`. This allows implementations to make
|
| 664 |
performance optimizations based on the absence of exceptions at
|
| 665 |
runtime.
|
| 666 |
|
| 667 |
[^27]: The functions `qsort()` and `bsearch()` [[alg.c.library]] meet
|
| 668 |
this condition.
|