79358.pdf
pdf at 230.pdf
Contents
Foreword
1 Scope
2 Normative references
3 Terms and definitions
4 General principles
4.1 Implementation compliance
4.1.1 General
4.1.2 Abstract machine
4.2 Structure of this document
4.3 Syntax notation
5 Lexical conventions
5.1 Separate translation
5.2 Phases of translation
5.3 Character sets
5.4 Preprocessing tokens
5.5 Alternative tokens
5.6 Tokens
5.7 Comments
5.8 Header names
5.9 Preprocessing numbers
5.10 Identifiers
5.11 Keywords
5.12 Operators and punctuators
5.13 Literals
5.13.1 Kinds of literals
5.13.2 Integer literals
5.13.3 Character literals
5.13.4 Floating-point literals
5.13.5 String literals
5.13.6 Boolean literals
5.13.7 Pointer literals
5.13.8 User-defined literals
6 Basics
6.1 Preamble
6.2 Declarations and definitions
6.3 One-definition rule
6.4 Scope
6.4.1 Declarative regions and scopes
6.4.2 Point of declaration
6.4.3 Block scope
6.4.4 Function parameter scope
6.4.5 Function scope
6.4.6 Namespace scope
6.4.7 Class scope
6.4.8 Enumeration scope
6.4.9 Template parameter scope
6.4.10 Name hiding
6.5 Name lookup
6.5.1 General
6.5.2 Unqualified name lookup
6.5.3 Argument-dependent name lookup
6.5.4 Qualified name lookup
6.5.4.1 General
6.5.4.2 Class members
6.5.4.3 Namespace members
6.5.5 Elaborated type specifiers
6.5.6 Class member access
6.5.7 Using-directives and namespace aliases
6.6 Program and linkage
6.7 Memory and objects
6.7.1 Memory model
6.7.2 Object model
6.7.3 Lifetime
6.7.4 Indeterminate values
6.7.5 Storage duration
6.7.5.1 General
6.7.5.2 Static storage duration
6.7.5.3 Thread storage duration
6.7.5.4 Automatic storage duration
6.7.5.5 Dynamic storage duration
6.7.5.5.1 General
6.7.5.5.2 Allocation functions
6.7.5.5.3 Deallocation functions
6.7.5.5.4 Safely-derived pointers
6.7.5.6 Duration of subobjects
6.7.6 Alignment
6.7.7 Temporary objects
6.8 Types
6.8.1 General
6.8.2 Fundamental types
6.8.3 Compound types
6.8.4 CV-qualifiers
6.8.5 Integer conversion rank
6.9 Program execution
6.9.1 Sequential execution
6.9.2 Multi-threaded executions and data races
6.9.2.1 General
6.9.2.2 Data races
6.9.2.3 Forward progress
6.9.3 Start and termination
6.9.3.1 main function
6.9.3.2 Static initialization
6.9.3.3 Dynamic initialization of non-local variables
6.9.3.4 Termination
7 Expressions
7.1 Preamble
7.2 Properties of expressions
7.2.1 Value category
7.2.2 Type
7.2.3 Context dependence
7.3 Standard conversions
7.3.1 General
7.3.2 Lvalue-to-rvalue conversion
7.3.3 Array-to-pointer conversion
7.3.4 Function-to-pointer conversion
7.3.5 Temporary materialization conversion
7.3.6 Qualification conversions
7.3.7 Integral promotions
7.3.8 Floating-point promotion
7.3.9 Integral conversions
7.3.10 Floating-point conversions
7.3.11 Floating-integral conversions
7.3.12 Pointer conversions
7.3.13 Pointer-to-member conversions
7.3.14 Function pointer conversions
7.3.15 Boolean conversions
7.4 Usual arithmetic conversions
7.5 Primary expressions
7.5.1 Literals
7.5.2 This
7.5.3 Parentheses
7.5.4 Names
7.5.4.1 General
7.5.4.2 Unqualified names
7.5.4.3 Qualified names
7.5.4.4 Destruction
7.5.5 Lambda expressions
7.5.5.1 General
7.5.5.2 Closure types
7.5.5.3 Captures
7.5.6 Fold expressions
7.5.7 Requires expressions
7.5.7.1 General
7.5.7.2 Simple requirements
7.5.7.3 Type requirements
7.5.7.4 Compound requirements
7.5.7.5 Nested requirements
7.6 Compound expressions
7.6.1 Postfix expressions
7.6.1.1 General
7.6.1.2 Subscripting
7.6.1.3 Function call
7.6.1.4 Explicit type conversion (functional notation)
7.6.1.5 Class member access
7.6.1.6 Increment and decrement
7.6.1.7 Dynamic cast
7.6.1.8 Type identification
7.6.1.9 Static cast
7.6.1.10 Reinterpret cast
7.6.1.11 Const cast
7.6.2 Unary expressions
7.6.2.1 General
7.6.2.2 Unary operators
7.6.2.3 Increment and decrement
7.6.2.4 Await
7.6.2.5 Sizeof
7.6.2.6 Alignof
7.6.2.7 noexcept operator
7.6.2.8 New
7.6.2.9 Delete
7.6.3 Explicit type conversion (cast notation)
7.6.4 Pointer-to-member operators
7.6.5 Multiplicative operators
7.6.6 Additive operators
7.6.7 Shift operators
7.6.8 Three-way comparison operator
7.6.9 Relational operators
7.6.10 Equality operators
7.6.11 Bitwise AND operator
7.6.12 Bitwise exclusive OR operator
7.6.13 Bitwise inclusive OR operator
7.6.14 Logical AND operator
7.6.15 Logical OR operator
7.6.16 Conditional operator
7.6.17 Yielding a value
7.6.18 Throwing an exception
7.6.19 Assignment and compound assignment operators
7.6.20 Comma operator
7.7 Constant expressions
8 Statements
8.1 Preamble
8.2 Labeled statement
8.3 Expression statement
8.4 Compound statement or block
8.5 Selection statements
8.5.1 General
8.5.2 The if statement
8.5.3 The switch statement
8.6 Iteration statements
8.6.1 General
8.6.2 The while statement
8.6.3 The do statement
8.6.4 The for statement
8.6.5 The range-based for statement
8.7 Jump statements
8.7.1 General
8.7.2 The break statement
8.7.3 The continue statement
8.7.4 The return statement
8.7.5 The co_return statement
8.7.6 The goto statement
8.8 Declaration statement
8.9 Ambiguity resolution
9 Declarations
9.1 Preamble
9.2 Specifiers
9.2.1 General
9.2.2 Storage class specifiers
9.2.3 Function specifiers
9.2.4 The typedef specifier
9.2.5 The friend specifier
9.2.6 The constexpr and consteval specifiers
9.2.7 The constinit specifier
9.2.8 The inline specifier
9.2.9 Type specifiers
9.2.9.1 General
9.2.9.2 The cv-qualifiers
9.2.9.3 Simple type specifiers
9.2.9.4 Elaborated type specifiers
9.2.9.5 Decltype specifiers
9.2.9.6 Placeholder type specifiers
9.2.9.6.1 General
9.2.9.6.2 Placeholder type deduction
9.2.9.7 Deduced class template specialization types
9.3 Declarators
9.3.1 General
9.3.2 Type names
9.3.3 Ambiguity resolution
9.3.4 Meaning of declarators
9.3.4.1 General
9.3.4.2 Pointers
9.3.4.3 References
9.3.4.4 Pointers to members
9.3.4.5 Arrays
9.3.4.6 Functions
9.3.4.7 Default arguments
9.4 Initializers
9.4.1 General
9.4.2 Aggregates
9.4.3 Character arrays
9.4.4 References
9.4.5 List-initialization
9.5 Function definitions
9.5.1 In general
9.5.2 Explicitly-defaulted functions
9.5.3 Deleted definitions
9.5.4 Coroutine definitions
9.6 Structured binding declarations
9.7 Enumerations
9.7.1 Enumeration declarations
9.7.2 The using enum declaration
9.8 Namespaces
9.8.1 General
9.8.2 Namespace definition
9.8.2.1 General
9.8.2.2 Unnamed namespaces
9.8.2.3 Namespace member definitions
9.8.3 Namespace alias
9.8.4 Using namespace directive
9.9 The using declaration
9.10 The asm declaration
9.11 Linkage specifications
9.12 Attributes
9.12.1 Attribute syntax and semantics
9.12.2 Alignment specifier
9.12.3 Carries dependency attribute
9.12.4 Deprecated attribute
9.12.5 Fallthrough attribute
9.12.6 Likelihood attributes
9.12.7 Maybe unused attribute
9.12.8 Nodiscard attribute
9.12.9 Noreturn attribute
9.12.10 No unique address attribute
10 Modules
10.1 Module units and purviews
10.2 Export declaration
10.3 Import declaration
10.4 Global module fragment
10.5 Private module fragment
10.6 Instantiation context
10.7 Reachability
11 Classes
11.1 Preamble
11.2 Properties of classes
11.3 Class names
11.4 Class members
11.4.1 General
11.4.2 Member functions
11.4.3 Non-static member functions
11.4.3.1 General
11.4.3.2 The this pointer
11.4.4 Special member functions
11.4.5 Constructors
11.4.5.1 General
11.4.5.2 Default constructors
11.4.5.3 Copy/move constructors
11.4.6 Copy/move assignment operator
11.4.7 Destructors
11.4.8 Conversions
11.4.8.1 General
11.4.8.2 Conversion by constructor
11.4.8.3 Conversion functions
11.4.9 Static members
11.4.9.1 General
11.4.9.2 Static member functions
11.4.9.3 Static data members
11.4.10 Bit-fields
11.4.11 Nested class declarations
11.4.12 Nested type names
11.5 Unions
11.5.1 General
11.5.2 Anonymous unions
11.6 Local class declarations
11.7 Derived classes
11.7.1 General
11.7.2 Multiple base classes
11.7.3 Virtual functions
11.7.4 Abstract classes
11.8 Member name lookup
11.9 Member access control
11.9.1 General
11.9.2 Access specifiers
11.9.3 Accessibility of base classes and base class members
11.9.4 Friends
11.9.5 Protected member access
11.9.6 Access to virtual functions
11.9.7 Multiple access
11.9.8 Nested classes
11.10 Initialization
11.10.1 General
11.10.2 Explicit initialization
11.10.3 Initializing bases and members
11.10.4 Initialization by inherited constructor
11.10.5 Construction and destruction
11.10.6 Copy/move elision
11.11 Comparisons
11.11.1 Defaulted comparison operator functions
11.11.2 Equality operator
11.11.3 Three-way comparison
11.11.4 Secondary comparison operators
11.12 Free store
12 Overloading
12.1 Preamble
12.2 Overloadable declarations
12.3 Declaration matching
12.4 Overload resolution
12.4.1 General
12.4.2 Candidate functions and argument lists
12.4.2.1 General
12.4.2.2 Function call syntax
12.4.2.2.1 General
12.4.2.2.2 Call to named function
12.4.2.2.3 Call to object of class type
12.4.2.3 Operators in expressions
12.4.2.4 Initialization by constructor
12.4.2.5 Copy-initialization of class by user-defined conversion
12.4.2.6 Initialization by conversion function
12.4.2.7 Initialization by conversion function for direct reference binding
12.4.2.8 Initialization by list-initialization
12.4.2.9 Class template argument deduction
12.4.3 Viable functions
12.4.4 Best viable function
12.4.4.1 General
12.4.4.2 Implicit conversion sequences
12.4.4.2.1 General
12.4.4.2.2 Standard conversion sequences
12.4.4.2.3 User-defined conversion sequences
12.4.4.2.4 Ellipsis conversion sequences
12.4.4.2.5 Reference binding
12.4.4.2.6 List-initialization sequence
12.4.4.3 Ranking implicit conversion sequences
12.5 Address of overloaded function
12.6 Overloaded operators
12.6.1 General
12.6.2 Unary operators
12.6.3 Binary operators
12.6.3.1 General
12.6.3.2 Simple assignment
12.6.4 Function call
12.6.5 Subscripting
12.6.6 Class member access
12.6.7 Increment and decrement
12.7 Built-in operators
12.8 User-defined literals
13 Templates
13.1 Preamble
13.2 Template parameters
13.3 Names of template specializations
13.4 Template arguments
13.4.1 General
13.4.2 Template type arguments
13.4.3 Template non-type arguments
13.4.4 Template template arguments
13.5 Template constraints
13.5.1 General
13.5.2 Constraints
13.5.2.1 General
13.5.2.2 Logical operations
13.5.2.3 Atomic constraints
13.5.3 Constrained declarations
13.5.4 Constraint normalization
13.5.5 Partial ordering by constraints
13.6 Type equivalence
13.7 Template declarations
13.7.1 General
13.7.2 Class templates
13.7.2.1 General
13.7.2.2 Member functions of class templates
13.7.2.3 Deduction guides
13.7.2.4 Member classes of class templates
13.7.2.5 Static data members of class templates
13.7.2.6 Enumeration members of class templates
13.7.3 Member templates
13.7.4 Variadic templates
13.7.5 Friends
13.7.6 Class template partial specializations
13.7.6.1 General
13.7.6.2 Matching of class template partial specializations
13.7.6.3 Partial ordering of class template specializations
13.7.6.4 Members of class template specializations
13.7.7 Function templates
13.7.7.1 General
13.7.7.2 Function template overloading
13.7.7.3 Partial ordering of function templates
13.7.8 Alias templates
13.7.9 Concept definitions
13.8 Name resolution
13.8.1 General
13.8.2 Locally declared names
13.8.3 Dependent names
13.8.3.1 General
13.8.3.2 Dependent types
13.8.3.3 Type-dependent expressions
13.8.3.4 Value-dependent expressions
13.8.3.5 Dependent template arguments
13.8.4 Non-dependent names
13.8.5 Dependent name resolution
13.8.5.1 Point of instantiation
13.8.5.2 Candidate functions
13.8.6 Friend names declared within a class template
13.9 Template instantiation and specialization
13.9.1 General
13.9.2 Implicit instantiation
13.9.3 Explicit instantiation
13.9.4 Explicit specialization
13.10 Function template specializations
13.10.1 General
13.10.2 Explicit template argument specification
13.10.3 Template argument deduction
13.10.3.1 General
13.10.3.2 Deducing template arguments from a function call
13.10.3.3 Deducing template arguments taking the address of a function template
13.10.3.4 Deducing conversion function template arguments
13.10.3.5 Deducing template arguments during partial ordering
13.10.3.6 Deducing template arguments from a type
13.10.3.7 Deducing template arguments from a function declaration
13.10.4 Overload resolution
14 Exception handling
14.1 Preamble
14.2 Throwing an exception
14.3 Constructors and destructors
14.4 Handling an exception
14.5 Exception specifications
14.6 Special functions
14.6.1 General
14.6.2 The std::terminate function
14.6.3 The std::uncaught_exceptions function
15 Preprocessing directives
15.1 Preamble
15.2 Conditional inclusion
15.3 Source file inclusion
15.4 Module directive
15.5 Header unit importation
15.6 Macro replacement
15.6.1 General
15.6.2 Argument substitution
15.6.3 The # operator
15.6.4 The ## operator
15.6.5 Rescanning and further replacement
15.6.6 Scope of macro definitions
15.7 Line control
15.8 Error directive
15.9 Pragma directive
15.10 Null directive
15.11 Predefined macro names
15.12 Pragma operator
16 Library introduction
16.1 General
16.2 The C standard library
16.3 Method of description
16.3.1 General
16.3.2 Structure of each clause
16.3.2.1 Elements
16.3.2.2 Summary
16.3.2.3 Requirements
16.3.2.4 Detailed specifications
16.3.2.5 C library
16.3.3 Other conventions
16.3.3.1 General
16.3.3.2 Exposition-only functions
16.3.3.3 Type descriptions
16.3.3.3.1 General
16.3.3.3.2 Exposition-only types
16.3.3.3.3 Enumerated types
16.3.3.3.4 Bitmask types
16.3.3.3.5 Character sequences
16.3.3.3.5.1 General
16.3.3.3.5.2 Byte strings
16.3.3.3.5.3 Multibyte strings
16.3.3.3.6 Customization Point Object types
16.3.3.4 Functions within classes
16.3.3.5 Private members
16.4 Library-wide requirements
16.4.1 General
16.4.2 Library contents and organization
16.4.2.1 General
16.4.2.2 Library contents
16.4.2.3 Headers
16.4.2.4 Freestanding implementations
16.4.3 Using the library
16.4.3.1 Overview
16.4.3.2 Headers
16.4.3.3 Linkage
16.4.4 Requirements on types and expressions
16.4.4.1 General
16.4.4.2 Template argument requirements
16.4.4.3 Swappable requirements
16.4.4.4 Cpp17NullablePointer requirements
16.4.4.5 Cpp17Hash requirements
16.4.4.6 Cpp17Allocator requirements
16.4.4.6.1 General
16.4.4.6.2 Allocator completeness requirements
16.4.5 Constraints on programs
16.4.5.1 Overview
16.4.5.2 Namespace use
16.4.5.2.1 Namespace std
16.4.5.2.2 Namespace posix
16.4.5.2.3 Namespaces for future standardization
16.4.5.3 Reserved names
16.4.5.3.1 General
16.4.5.3.2 Zombie names
16.4.5.3.3 Macro names
16.4.5.3.4 External linkage
16.4.5.3.5 Types
16.4.5.3.6 User-defined literal suffixes
16.4.5.4 Headers
16.4.5.5 Derived classes
16.4.5.6 Replacement functions
16.4.5.7 Handler functions
16.4.5.8 Other functions
16.4.5.9 Function arguments
16.4.5.10 Library object access
16.4.5.11 Semantic requirements
16.4.6 Conforming implementations
16.4.6.1 Overview
16.4.6.2 Headers
16.4.6.3 Restrictions on macro definitions
16.4.6.4 Non-member functions
16.4.6.5 Member functions
16.4.6.6 Friend functions
16.4.6.7 Constexpr functions and constructors
16.4.6.8 Requirements for stable algorithms
16.4.6.9 Reentrancy
16.4.6.10 Data race avoidance
16.4.6.11 Protection within classes
16.4.6.12 Derived classes
16.4.6.13 Restrictions on exception handling
16.4.6.14 Restrictions on storage of pointers
16.4.6.15 Value of error codes
16.4.6.16 Moved-from state of library types
17 Language support library
17.1 General
17.2 Common definitions
17.2.1 Header
synopsis
17.2.2 Header synopsis
17.2.3 Null pointers
17.2.4 Sizes, alignments, and offsets
17.2.5 byte type operations
17.3 Implementation properties
17.3.1 General
17.3.2 Header synopsis
17.3.3 Header synopsis
17.3.4 Floating-point type properties
17.3.4.1 Type float_round_style
17.3.4.2 Type float_denorm_style
17.3.5 Class template numeric_limits
17.3.5.1 General
17.3.5.2 numeric_limits members
17.3.5.3 numeric_limits specializations
17.3.6 Header synopsis
17.3.7 Header synopsis
17.4 Integer types
17.4.1 General
17.4.2 Header synopsis
17.5 Startup and termination
17.6 Dynamic memory management
17.6.1 General
17.6.2 Header synopsis
17.6.3 Storage allocation and deallocation
17.6.3.1 General
17.6.3.2 Single-object forms
17.6.3.3 Array forms
17.6.3.4 Non-allocating forms
17.6.3.5 Data races
17.6.4 Storage allocation errors
17.6.4.1 Class bad_alloc
17.6.4.2 Class bad_array_new_length
17.6.4.3 Type new_handler
17.6.4.4 set_new_handler
17.6.4.5 get_new_handler
17.6.5 Pointer optimization barrier
17.6.6 Hardware interference size
17.7 Type identification
17.7.1 General
17.7.2 Header synopsis
17.7.3 Class type_info
17.7.4 Class bad_cast
17.7.5 Class bad_typeid
17.8 Source location
17.8.1 Header synopsis
17.8.2 Class source_location
17.8.2.1 General
17.8.2.2 Creation
17.8.2.3 Observers
17.9 Exception handling
17.9.1 General
17.9.2 Header synopsis
17.9.3 Class exception
17.9.4 Class bad_exception
17.9.5 Abnormal termination
17.9.5.1 Type terminate_handler
17.9.5.2 set_terminate
17.9.5.3 get_terminate
17.9.5.4 terminate
17.9.6 uncaught_exceptions
17.9.7 Exception propagation
17.9.8 nested_exception
17.10 Initializer lists
17.10.1 General
17.10.2 Header synopsis
17.10.3 Initializer list constructors
17.10.4 Initializer list access
17.10.5 Initializer list range access
17.11 Comparisons
17.11.1 Header synopsis
17.11.2 Comparison category types
17.11.2.1 Preamble
17.11.2.2 Class partial_ordering
17.11.2.3 Class weak_ordering
17.11.2.4 Class strong_ordering
17.11.3 Class template common_comparison_category
17.11.4 Concept three_way_comparable
17.11.5 Result of three-way comparison
17.11.6 Comparison algorithms
17.12 Coroutines
17.12.1 General
17.12.2 Header synopsis
17.12.3 Coroutine traits
17.12.3.1 General
17.12.3.2 Class template coroutine_traits
17.12.4 Class template coroutine_handle
17.12.4.1 General
17.12.4.2 Construct/reset
17.12.4.3 Export/import
17.12.4.4 Observers
17.12.4.5 Resumption
17.12.4.6 Promise access
17.12.4.7 Comparison operators
17.12.4.8 Hash support
17.12.5 No-op coroutines
17.12.5.1 Class noop_coroutine_promise
17.12.5.2 Class coroutine_handle
17.12.5.2.1 Observers
17.12.5.2.2 Resumption
17.12.5.2.3 Promise access
17.12.5.2.4 Address
17.12.5.3 Function noop_coroutine
17.12.6 Trivial awaitables
17.13 Other runtime support
17.13.1 General
17.13.2 Header synopsis
17.13.3 Header synopsis
17.13.4 Header synopsis
17.13.5 Signal handlers
18 Concepts library
18.1 General
18.2 Equality preservation
18.3 Header synopsis
18.4 Language-related concepts
18.4.1 General
18.4.2 Concept same_as
18.4.3 Concept derived_from
18.4.4 Concept convertible_to
18.4.5 Concept common_reference_with
18.4.6 Concept common_with
18.4.7 Arithmetic concepts
18.4.8 Concept assignable_from
18.4.9 Concept swappable
18.4.10 Concept destructible
18.4.11 Concept constructible_from
18.4.12 Concept default_initializable
18.4.13 Concept move_constructible
18.4.14 Concept copy_constructible
18.5 Comparison concepts
18.5.1 General
18.5.2 Boolean testability
18.5.3 Concept equality_comparable
18.5.4 Concept totally_ordered
18.6 Object concepts
18.7 Callable concepts
18.7.1 General
18.7.2 Concept invocable
18.7.3 Concept regular_invocable
18.7.4 Concept predicate
18.7.5 Concept relation
18.7.6 Concept equivalence_relation
18.7.7 Concept strict_weak_order
19 Diagnostics library
19.1 General
19.2 Exception classes
19.2.1 General
19.2.2 Header synopsis
19.2.3 Class logic_error
19.2.4 Class domain_error
19.2.5 Class invalid_argument
19.2.6 Class length_error
19.2.7 Class out_of_range
19.2.8 Class runtime_error
19.2.9 Class range_error
19.2.10 Class overflow_error
19.2.11 Class underflow_error
19.3 Assertions
19.3.1 General
19.3.2 Header synopsis
19.3.3 The assert macro
19.4 Error numbers
19.4.1 General
19.4.2 Header synopsis
19.5 System error support
19.5.1 General
19.5.2 Header synopsis
19.5.3 Class error_category
19.5.3.1 Overview
19.5.3.2 Virtual members
19.5.3.3 Non-virtual members
19.5.3.4 Program-defined classes derived from error_category
19.5.3.5 Error category objects
19.5.4 Class error_code
19.5.4.1 Overview
19.5.4.2 Constructors
19.5.4.3 Modifiers
19.5.4.4 Observers
19.5.4.5 Non-member functions
19.5.5 Class error_condition
19.5.5.1 Overview
19.5.5.2 Constructors
19.5.5.3 Modifiers
19.5.5.4 Observers
19.5.5.5 Non-member functions
19.5.6 Comparison operator functions
19.5.7 System error hash support
19.5.8 Class system_error
19.5.8.1 Overview
19.5.8.2 Members
20 General utilities library
20.1 General
20.2 Utility components
20.2.1 Header synopsis
20.2.2 swap
20.2.3 exchange
20.2.4 Forward/move helpers
20.2.5 Function template as_const
20.2.6 Function template declval
20.2.7 Integer comparison functions
20.3 Compile-time integer sequences
20.3.1 In general
20.3.2 Class template integer_sequence
20.3.3 Alias template make_integer_sequence
20.4 Pairs
20.4.1 In general
20.4.2 Class template pair
20.4.3 Specialized algorithms
20.4.4 Tuple-like access to pair
20.4.5 Piecewise construction
20.5 Tuples
20.5.1 In general
20.5.2 Header synopsis
20.5.3 Class template tuple
20.5.3.1 Construction
20.5.3.2 Assignment
20.5.3.3 swap
20.5.4 Tuple creation functions
20.5.5 Calling a function with a tuple of arguments
20.5.6 Tuple helper classes
20.5.7 Element access
20.5.8 Relational operators
20.5.9 Tuple traits
20.5.10 Tuple specialized algorithms
20.6 Optional objects
20.6.1 In general
20.6.2 Header synopsis
20.6.3 Class template optional
20.6.3.1 General
20.6.3.2 Constructors
20.6.3.3 Destructor
20.6.3.4 Assignment
20.6.3.5 Swap
20.6.3.6 Observers
20.6.3.7 Modifiers
20.6.4 No-value state indicator
20.6.5 Class bad_optional_access
20.6.6 Relational operators
20.6.7 Comparison with nullopt
20.6.8 Comparison with T
20.6.9 Specialized algorithms
20.6.10 Hash support
20.7 Variants
20.7.1 In general
20.7.2 Header synopsis
20.7.3 Class template variant
20.7.3.1 General
20.7.3.2 Constructors
20.7.3.3 Destructor
20.7.3.4 Assignment
20.7.3.5 Modifiers
20.7.3.6 Value status
20.7.3.7 Swap
20.7.4 variant helper classes
20.7.5 Value access
20.7.6 Relational operators
20.7.7 Visitation
20.7.8 Class monostate
20.7.9 monostate relational operators
20.7.10 Specialized algorithms
20.7.11 Class bad_variant_access
20.7.12 Hash support
20.8 Storage for any type
20.8.1 General
20.8.2 Header synopsis
20.8.3 Class bad_any_cast
20.8.4 Class any
20.8.4.1 General
20.8.4.2 Construction and destruction
20.8.4.3 Assignment
20.8.4.4 Modifiers
20.8.4.5 Observers
20.8.5 Non-member functions
20.9 Bitsets
20.9.1 Header synopsis
20.9.2 Class template bitset
20.9.2.1 General
20.9.2.2 Constructors
20.9.2.3 Members
20.9.3 bitset hash support
20.9.4 bitset operators
20.10 Memory
20.10.1 In general
20.10.2 Header synopsis
20.10.3 Pointer traits
20.10.3.1 General
20.10.3.2 Member types
20.10.3.3 Member functions
20.10.3.4 Optional members
20.10.4 Pointer conversion
20.10.5 Pointer safety
20.10.6 Pointer alignment
20.10.7 Allocator argument tag
20.10.8 uses_allocator
20.10.8.1 uses_allocator trait
20.10.8.2 Uses-allocator construction
20.10.9 Allocator traits
20.10.9.1 General
20.10.9.2 Member types
20.10.9.3 Static member functions
20.10.10 The default allocator
20.10.10.1 General
20.10.10.2 Members
20.10.10.3 Operators
20.10.11 addressof
20.10.12 C library memory allocation
20.11 Smart pointers
20.11.1 Class template unique_ptr
20.11.1.1 General
20.11.1.2 Default deleters
20.11.1.2.1 In general
20.11.1.2.2 default_delete
20.11.1.2.3 default_delete
20.11.1.3 unique_ptr for single objects
20.11.1.3.1 General
20.11.1.3.2 Constructors
20.11.1.3.3 Destructor
20.11.1.3.4 Assignment
20.11.1.3.5 Observers
20.11.1.3.6 Modifiers
20.11.1.4 unique_ptr for array objects with a runtime length
20.11.1.4.1 General
20.11.1.4.2 Constructors
20.11.1.4.3 Assignment
20.11.1.4.4 Observers
20.11.1.4.5 Modifiers
20.11.1.5 Creation
20.11.1.6 Specialized algorithms
20.11.1.7 I/O
20.11.2 Class bad_weak_ptr
20.11.3 Class template shared_ptr
20.11.3.1 General
20.11.3.2 Constructors
20.11.3.3 Destructor
20.11.3.4 Assignment
20.11.3.5 Modifiers
20.11.3.6 Observers
20.11.3.7 Creation
20.11.3.8 Comparison
20.11.3.9 Specialized algorithms
20.11.3.10 Casts
20.11.3.11 get_deleter
20.11.3.12 I/O
20.11.4 Class template weak_ptr
20.11.4.1 General
20.11.4.2 Constructors
20.11.4.3 Destructor
20.11.4.4 Assignment
20.11.4.5 Modifiers
20.11.4.6 Observers
20.11.4.7 Specialized algorithms
20.11.5 Class template owner_less
20.11.6 Class template enable_shared_from_this
20.11.7 Smart pointer hash support
20.12 Memory resources
20.12.1 Header synopsis
20.12.2 Class memory_resource
20.12.2.1 General
20.12.2.2 Public member functions
20.12.2.3 Private virtual member functions
20.12.2.4 Equality
20.12.3 Class template polymorphic_allocator
20.12.3.1 General
20.12.3.2 Constructors
20.12.3.3 Member functions
20.12.3.4 Equality
20.12.4 Access to program-wide memory_resource objects
20.12.5 Pool resource classes
20.12.5.1 Classes synchronized_pool_resource and unsynchronized_pool_resource
20.12.5.2 pool_options data members
20.12.5.3 Constructors and destructors
20.12.5.4 Members
20.12.6 Class monotonic_buffer_resource
20.12.6.1 General
20.12.6.2 Constructors and destructor
20.12.6.3 Members
20.13 Class template scoped_allocator_adaptor
20.13.1 Header synopsis
20.13.2 Member types
20.13.3 Constructors
20.13.4 Members
20.13.5 Operators
20.14 Function objects
20.14.1 General
20.14.2 Header synopsis
20.14.3 Definitions
20.14.4 Requirements
20.14.5 Function template invoke
20.14.6 Class template reference_wrapper
20.14.6.1 General
20.14.6.2 Constructors and destructor
20.14.6.3 Assignment
20.14.6.4 Access
20.14.6.5 Invocation
20.14.6.6 Helper functions
20.14.7 Arithmetic operations
20.14.7.1 General
20.14.7.2 Class template plus
20.14.7.3 Class template minus
20.14.7.4 Class template multiplies
20.14.7.5 Class template divides
20.14.7.6 Class template modulus
20.14.7.7 Class template negate
20.14.8 Comparisons
20.14.8.1 General
20.14.8.2 Class template equal_to
20.14.8.3 Class template not_equal_to
20.14.8.4 Class template greater
20.14.8.5 Class template less
20.14.8.6 Class template greater_equal
20.14.8.7 Class template less_equal
20.14.8.8 Class compare_three_way
20.14.9 Concept-constrained comparisons
20.14.10 Logical operations
20.14.10.1 General
20.14.10.2 Class template logical_and
20.14.10.3 Class template logical_or
20.14.10.4 Class template logical_not
20.14.11 Bitwise operations
20.14.11.1 General
20.14.11.2 Class template bit_and
20.14.11.3 Class template bit_or
20.14.11.4 Class template bit_xor
20.14.11.5 Class template bit_not
20.14.12 Class identity
20.14.13 Function template not_fn
20.14.14 Function template bind_front
20.14.15 Function object binders
20.14.15.1 General
20.14.15.2 Class template is_bind_expression
20.14.15.3 Class template is_placeholder
20.14.15.4 Function template bind
20.14.15.5 Placeholders
20.14.16 Function template mem_fn
20.14.17 Polymorphic function wrappers
20.14.17.1 General
20.14.17.2 Class bad_function_call
20.14.17.3 Class template function
20.14.17.3.1 General
20.14.17.3.2 Constructors and destructor
20.14.17.3.3 Modifiers
20.14.17.3.4 Capacity
20.14.17.3.5 Invocation
20.14.17.3.6 Target access
20.14.17.3.7 Null pointer comparison operator functions
20.14.17.3.8 Specialized algorithms
20.14.18 Searchers
20.14.18.1 General
20.14.18.2 Class template default_searcher
20.14.18.3 Class template boyer_moore_searcher
20.14.18.4 Class template boyer_moore_horspool_searcher
20.14.19 Class template hash
20.15 Metaprogramming and type traits
20.15.1 General
20.15.2 Requirements
20.15.3 Header synopsis
20.15.4 Helper classes
20.15.5 Unary type traits
20.15.5.1 General
20.15.5.2 Primary type categories
20.15.5.3 Composite type traits
20.15.5.4 Type properties
20.15.6 Type property queries
20.15.7 Relationships between types
20.15.8 Transformations between types
20.15.8.1 General
20.15.8.2 Const-volatile modifications
20.15.8.3 Reference modifications
20.15.8.4 Sign modifications
20.15.8.5 Array modifications
20.15.8.6 Pointer modifications
20.15.8.7 Other transformations
20.15.9 Logical operator traits
20.15.10 Member relationships
20.15.11 Constant evaluation context
20.16 Compile-time rational arithmetic
20.16.1 In general
20.16.2 Header synopsis
20.16.3 Class template ratio
20.16.4 Arithmetic on ratios
20.16.5 Comparison of ratios
20.16.6 SI types for ratio
20.17 Class type_index
20.17.1 Header synopsis
20.17.2 type_index overview
20.17.3 type_index members
20.17.4 Hash support
20.18 Execution policies
20.18.1 In general
20.18.2 Header synopsis
20.18.3 Execution policy type trait
20.18.4 Sequenced execution policy
20.18.5 Parallel execution policy
20.18.6 Parallel and unsequenced execution policy
20.18.7 Unsequenced execution policy
20.18.8 Execution policy objects
20.19 Primitive numeric conversions
20.19.1 Header synopsis
20.19.2 Primitive numeric output conversion
20.19.3 Primitive numeric input conversion
20.20 Formatting
20.20.1 Header synopsis
20.20.2 Format string
20.20.2.1 In general
20.20.2.2 Standard format specifiers
20.20.3 Error reporting
20.20.4 Formatting functions
20.20.5 Formatter
20.20.5.1 Formatter requirements
20.20.5.2 Formatter specializations
20.20.5.3 Class template basic_format_parse_context
20.20.5.4 Class template basic_format_context
20.20.6 Arguments
20.20.6.1 Class template basic_format_arg
20.20.6.2 Class template format-arg-store
20.20.6.3 Class template basic_format_args
20.20.7 Class format_error
21 Strings library
21.1 General
21.2 Character traits
21.2.1 General
21.2.2 Character traits requirements
21.2.3 Traits typedefs
21.2.4 char_traits specializations
21.2.4.1 General
21.2.4.2 struct char_traits
21.2.4.3 struct char_traits
21.2.4.4 struct char_traits
21.2.4.5 struct char_traits
21.2.4.6 struct char_traits
21.3 String classes
21.3.1 General
21.3.2 Header synopsis
21.3.3 Class template basic_string
21.3.3.1 General
21.3.3.2 General requirements
21.3.3.3 Constructors and assignment operators
21.3.3.4 Iterator support
21.3.3.5 Capacity
21.3.3.6 Element access
21.3.3.7 Modifiers
21.3.3.7.1 basic_string::operator+=
21.3.3.7.2 basic_string::append
21.3.3.7.3 basic_string::assign
21.3.3.7.4 basic_string::insert
21.3.3.7.5 basic_string::erase
21.3.3.7.6 basic_string::replace
21.3.3.7.7 basic_string::copy
21.3.3.7.8 basic_string::swap
21.3.3.8 String operations
21.3.3.8.1 Accessors
21.3.3.8.2 Searching
21.3.3.8.3 basic_string::substr
21.3.3.8.4 basic_string::compare
21.3.3.8.5 basic_string::starts_with
21.3.3.8.6 basic_string::ends_with
21.3.4 Non-member functions
21.3.4.1 operator+
21.3.4.2 Non-member comparison operator functions
21.3.4.3 swap
21.3.4.4 Inserters and extractors
21.3.4.5 Erasure
21.3.5 Numeric conversions
21.3.6 Hash support
21.3.7 Suffix for basic_string literals
21.4 String view classes
21.4.1 General
21.4.2 Header synopsis
21.4.3 Class template basic_string_view
21.4.3.1 General
21.4.3.2 Construction and assignment
21.4.3.3 Iterator support
21.4.3.4 Capacity
21.4.3.5 Element access
21.4.3.6 Modifiers
21.4.3.7 String operations
21.4.3.8 Searching
21.4.4 Deduction guide
21.4.5 Non-member comparison functions
21.4.6 Inserters and extractors
21.4.7 Hash support
21.4.8 Suffix for basic_string_view literals
21.5 Null-terminated sequence utilities
21.5.1 Header synopsis
21.5.2 Header synopsis
21.5.3 Header synopsis
21.5.4 Header synopsis
21.5.5 Header synopsis
21.5.6 Multibyte / wide string and character conversion functions
22 Containers library
22.1 General
22.2 Container requirements
22.2.1 General container requirements
22.2.2 Container data races
22.2.3 Sequence containers
22.2.4 Node handles
22.2.4.1 Overview
22.2.4.2 Constructors, copy, and assignment
22.2.4.3 Destructor
22.2.4.4 Observers
22.2.4.5 Modifiers
22.2.5 Insert return type
22.2.6 Associative containers
22.2.6.1 General
22.2.6.2 Exception safety guarantees
22.2.7 Unordered associative containers
22.2.7.1 General
22.2.7.2 Exception safety guarantees
22.3 Sequence containers
22.3.1 In general
22.3.2 Header synopsis
22.3.3 Header synopsis
22.3.4 Header synopsis
22.3.5 Header synopsis
22.3.6 Header synopsis
22.3.7 Class template array
22.3.7.1 Overview
22.3.7.2 Constructors, copy, and assignment
22.3.7.3 Member functions
22.3.7.4 Specialized algorithms
22.3.7.5 Zero-sized arrays
22.3.7.6 Array creation functions
22.3.7.7 Tuple interface
22.3.8 Class template deque
22.3.8.1 Overview
22.3.8.2 Constructors, copy, and assignment
22.3.8.3 Capacity
22.3.8.4 Modifiers
22.3.8.5 Erasure
22.3.9 Class template forward_list
22.3.9.1 Overview
22.3.9.2 Constructors, copy, and assignment
22.3.9.3 Iterators
22.3.9.4 Element access
22.3.9.5 Modifiers
22.3.9.6 Operations
22.3.9.7 Erasure
22.3.10 Class template list
22.3.10.1 Overview
22.3.10.2 Constructors, copy, and assignment
22.3.10.3 Capacity
22.3.10.4 Modifiers
22.3.10.5 Operations
22.3.10.6 Erasure
22.3.11 Class template vector
22.3.11.1 Overview
22.3.11.2 Constructors
22.3.11.3 Capacity
22.3.11.4 Data
22.3.11.5 Modifiers
22.3.11.6 Erasure
22.3.12 Class vector
22.4 Associative containers
22.4.1 In general
22.4.2 Header