; and ``..'' Pathnames ``.'' then Y is empty. are relative paths. as the type of main. An object has a type. An object can have a name. any is not a literal type. is synonymous with ``...''. A try-block is a statement. A link to an existing file. A statement can be labeled. Linkage specifications nest. A template name has linkage. A declaration is a statement. Constructors do not have names. Only labels have function scope. Every byte has a unique address. The type mask is a bitmask type. An initializer list may be empty. Does not apply to dot and dot-dot. The member eof() shall return EOF. The value of argv[argc] shall be 0. An array is a contiguous container. flip reverses the state of the bit. An empty-declaration has no effect. A throw-expression is of type void. An empty ntbs has a length of zero. Conversion functions are inherited. The member eof() shall return WEOF. A union shall not have base classes. There are several kinds of literals. Conversion functions can be virtual. List-initialization semantics apply. A fold-expression is type-dependent. Some names denote types or templates. A destructor shall take no arguments. Iteration statements specify looping. [basic.link] discusses linkage issues. A glvalue shall not have type cv void. A function template is not a function. Default arguments are more restricted. Copy-initialization may invoke a move. Many operations are volatile-qualified. Attributes are described in [dcl.attr]. Unqualified name lookup ignores labels. The value of argc shall be non-negative. An unevaluated operand is not evaluated. Postfix expressions group left-to-right. The comma operator groups left-to-right. Data races result in undefined behavior. The digits 8 and 9 are not octal digits. There is one name space for macro names. An init-statement ends with a semicolon. An init-statement ends with a semicolon. A template-declaration is a declaration. CR(A, B) represents common_type_t. A class definition introduces a new type. A bit-field shall not be a static member. Base class subobjects may have zero size. Symbolic links are often called symlinks. A character container type is a POD type. numpunct<> specifies numeric punctuation. The operator ``?:'' cannot be overloaded. All signal handlers shall have C linkage. A static data member shall not be mutable. A union shall not be used as a base class. at() throws out_of_range if n >= a.size(). The operand of & shall not be a bit-field. A wide-character literal has type wchar_t. The d-char-sequence serves as a delimiter. Conversions obey the access control rules. A sizeof... expression is a pack expansion. A C++ header may include other C++ headers. A compound statement defines a block scope. Parallel algorithms are algorithm overloads. A namespace member name has namespace scope. A synonym for integral type is integer type. Storage management is handled automatically. POSIX is a registered trademark of The IEEE. A destructor can also be invoked explicitly. An identifier label declares the identifier. A destructor shall not be a member template. Values of type bool are either true or false. A class can be declared within another class. Each enumeration also has an underlying type. Where syntactically correct and where ``...'' The relational operators group left-to-right. without causing an ios::failure to be thrown. without causing an ios::failure to be thrown. Equality and inequality might not be defined. Two end-of-stream iterators are always equal. Traits::char_type shall be the same as CharT. The linkage of main is implementation-defined. The acronym POD stands for ``plain old data''. A static member function shall not be virtual. A local class cannot have static data members. A function parameter pack is a pack expansion. In some contexts, unevaluated operands appear. Conformance is specified in terms of behavior. A file has certain attributes, including type. A directory_entry object stores a path object. The type of N in the type T[N] is std::size_t. Every call wrapper shall be MoveConstructible. Friendship is neither inherited nor transitive. The map class supports bidirectional iterators. The set class supports bidirectional iterators. A using-declaration shall not name a namespace. Zero-length arrays do not have a first element. The binary * operator indicates multiplication. Files can be written to, or read from, or both. Filenames dot and dot-dot have special meaning. A path in normal form is said to be normalized. Dereferenceable values are always non-singular. The address of a destructor shall not be taken. thread::id shall be a trivially copyable class. There are two cv-qualifiers, const and volatile. There is no ``reference-to-member'' type in C++. is not part of an abstract-declarator, ``, ...'' A closure object behaves like a function object. A link is either a hard link or a symbolic link. An escape sequence specifies a single character. The address of a constructor shall not be taken. Operations on Traits shall not throw exceptions. A member function template shall not be virtual. operator()(x, y) shall return x.owner_before(y). bind uses is_placeholder to detect placeholders. A UnaryTypeTrait describes a property of a type. Types describe objects, references, or functions. Stricter alignments have larger alignment values. A member function is a member that is a function. A local class shall not have static data members. Function parameters cannot be declared constexpr. A using-declaration shall not name a template-id. A ctor-initializer is used only in a constructor. A derived-to-base Conversion has Conversion rank. Labels shall not be redeclared within a function. Jump statements unconditionally transfer control. The mutex types shall not be copyable or movable. An allocation function can be a function template. Member functions of a local class have no linkage. Alignment of bit-fields is implementation-defined. A union-like class X has a set of variant members. Forming a pointer to reference type is ill-formed. a typedef-name that names a class is a class-name. The shift operators << and >> group left-to-right. A string literal, such as "abc", is a static ntbs. In general, a default constructor is not required. The null value shall be equivalent only to itself. An alias template is a name for a family of types. The name of the alias template is a template-name. A callable object is an object of a callable type. An anonymous union shall not have member functions. The unordered_map class supports forward iterators. The unordered_set class supports forward iterators. A linkage specification does not establish a scope. In contexts where comma is given a special meaning, The normal form for an empty path is an empty path. A template type argument may be an incomplete type. The stored instance is called the contained object. A call wrapper is an object of a call wrapper type. A bit-field shall have integral or enumeration type. If a node handle is empty, it contains no allocator. unordered_set and unordered_map support unique keys. The multimap class supports bidirectional iterators. The multiset class supports bidirectional iterators. A deleted function is implicitly an inline function. Arguments of type Source shall not be null pointers. [conventions] describes other editorial conventions. Access control rules apply to member template names. Each default argument is instantiated independently. A TransformationTrait modifies a property of a type. A class shall not be defined in a friend declaration. Not all algorithms have parallel algorithm overloads. The function main shall not be used within a program. A class nested within a local class is a local class. Fast random access to list elements is not supported. A reference can be thought of as a name of an object. Throwing an exception transfers control to a handler. an id-expression can appear after . and -> operators. Expressions with unary operators group right-to-left. For dated references, only the edition cited applies. Objects can contain other objects, called subobjects. The execution of unsequenced evaluations can overlap. Characters in concatenated strings are kept distinct. Special member functions obey the usual access rules. Access control is applied after ambiguity resolution. The mutex types shall meet the Lockable requirements. shared_mutex may be a synonym for shared_timed_mutex. A static member function does not have a this pointer. The ``implicit int'' rule of C is no longer supported. The ``implicit int'' rule of C is no longer supported. A namespace is an optionally-named declarative region. An init-capture followed by an ellipsis is ill-formed. The names defined in the library have namespace scope. A character string that represents the name of a path. For input iterators, a == b does not imply ++a == ++b. A static ntbs is an ntbs with static storage duration. Both recursive and non-recursive mutexes are supplied. bind uses is_bind_expression to detect subexpressions. The name lookup rules are summarized in [basic.lookup]. A variable declared at block scope is a local variable. Values of type bool participate in integral promotions. sizeof(std::nullptr_t) shall be equal to sizeof(void*). Keys with the same hash code appear in the same bucket. A using-declaration shall not name a scoped enumerator. The one-definition rule applies to deleted definitions. A class can be derived from any number of base classes. An unevaluated operand is considered a full-expression. The static_cast operator shall not cast away constness. The right operand is sequenced before the left operand. The order of evaluation of ## operators is unspecified. A class template specialization is a distinct template. In Table [tab:time.clock] C1 and C2 denote clock types. A virtual member function is odr-used if it is not pure. Objects shall not be defined to have an incomplete type. A glvalue may have complete or incomplete non-void type. Non-static data members shall not have incomplete types. Static members obey the usual class member access rules. A non-const reference shall not be bound to a bit-field. For a set both the key_type and value_type are Key. The unordered_multimap class supports forward iterators. The unordered_multiset class supports forward iterators. Types shall not be defined in return or parameter types. The nested-name-specifier :: names the global namespace. std::size_t is defined in the standard header . and where the reference binding (if any) binds directly. Some file systems support multiple hard links to a file. Acronym for ``null-terminated character-type sequence''. It is impossible to store things into istream iterators. A static ntmbs is an ntmbs with static storage duration. The put() members make no provision for error reporting. Possible definitions include 0 and 0L, but not (void*)0. Template definitions shall obey the one-definition rule. A string literal is not an acceptable template-argument. unique_lock meets the BasicLockable requirements. shared_lock meets the TimedLockable requirements. A default-constructed future object has no shared state. reference_wrapper shall be a trivially copyable type. A fence with release semantics is called a release fence. A deallocation function may have more than one parameter. Characters can be explicitly declared unsigned or signed. The type of this in a member function of a class X is X*. A class declared within another is called a nested class. An attribute followed by an ellipsis is a pack expansion. A default argument is not part of the type of a function. A separate errno value shall be provided for each thread. Implicit odr-uses of this can result in implicit capture. The result of a const_cast refers to the original entity. Constant expressions can be evaluated during translation. A directory entry that associates a filename with a file. An end iterator shall not be equal to a non-end iterator. A d-char-sequence shall consist of at most 16 characters. Class ctype encapsulates the C library features. Virtual functions are provided for several numeric types. A text line shall not begin with a # preprocessing token. Except as indicated, statements are executed in sequence. The scope of a label is the function in which it appears. A function returns to its caller by the return statement. A friend template shall not be declared in a local class. The enum values of future_errc are distinct and not zero. A function object is an object of a function object type. A fence with acquire semantics is called an acquire fence. A translation unit consists of a sequence of declarations. Aggregates of class type are described in [dcl.init.aggr]. The name of a local class is local to its enclosing scope. The use of dynamic-exception-specifications is deprecated. The representation of types is described in [basic.types]. A C++ program need not all be translated at the same time. A destructor is used to destroy objects of its class type. Non-deduced arguments allow the full range of conversions. A shared_ptr object is empty if it does not own a pointer. Any expression can be explicitly converted to type cv void. The complexities of the expressions are sequence dependent. Lvalue references and rvalue references are distinct types. An ``array of N cv-qualifier-seq T'' has cv-qualified type. Access control is not considered in determining overriding. The use of dynamic-exception-specifications is deprecated . Recursive calls are permitted, except to the main function. The result of the expression const_cast(v) is of type T. The value of E1 >> E2 is E1 right-shifted E2 bit positions. Windows is a registered trademark of Microsoft Corporation. Nonmutable iterators are referred to as constant iterators. Range [i, j) is valid if and only if j is reachable from i. Entities in the C++ standard library have external linkage. The execution of notify_one and notify_all shall be atomic. A member function of a class X can be a friend of a class Y. The storage duration categories apply to references as well. Bit-fields are packed into some addressable allocation unit. A prvalue of type T can be converted to an xvalue of type T. A linkage-specification shall occur only in namespace scope. The reinterpret_cast operator shall not cast away constness. The size of a most derived class shall be greater than zero. Literals include strings and character and numeric literals. A translation unit may include library headers in any order. Each of the standard categories includes a family of facets. Selection statements choose one of several flows of control. Alignments are represented as values of the type std::size_t. Unnamed bit-fields are not members and cannot be initialized. For a multiset both the key_type and value_type are Key. the value contained in the referenced object is not accessed. Two null pointer values of the same type shall compare equal. A function shall be defined only in namespace or class scope. A base-specifier followed by an ellipsis is a pack expansion. Pointers and references to an abstract class can be declared. A member of an anonymous union shall not be captured by copy. A simple-capture followed by an ellipsis is a pack expansion. The multiplicative operators *, /, and % group left-to-right. A symbolic link can be thought of as a raw pointer to a file. It is impossible to assign a character via an input iterator. A char16_t literal containing multiple c-chars is ill-formed. A char32_t literal containing multiple c-chars is ill-formed. Certain types and macros are defined in more than one header. For an unnamed locale, locale::name() returns the string "*". Both the unary and binary forms of + - * & can be overloaded. The order of evaluation of # and ## operators is unspecified. For initialization of objects of class type see [class.init]. A conversion to void does not invoke any conversion function. dynamic_casts can be used during construction or destruction. Objects of type unique_lock are not copyable but are movable. Objects of type shared_lock are not copyable but are movable. Objects of type bad_any_cast are thrown by a failed any_cast. A BinaryTypeTrait describes a relationship between two types. Fences can have acquire semantics, release semantics, or both. A specialization of a member class template is a nested class. A static data member is not part of the subobjects of a class. Function-specifiers can be used only in function declarations. A typedef-name can also be introduced by an alias-declaration. The inline keyword has no effect on the linkage of a function. It is unspecified whether or not a reference requires storage. The handlers for a try block are tried in order of appearance. An id-expression is a restricted form of a primary-expression. The result of the expression (T) cast-expression is of type T. All operations on a given mutex occur in a single total order. An object within a file system that holds user or system data. There may be multiple pathnames that resolve to the same file. A character string literal is a string-literal with no prefix. A constructor is used to initialize objects of its class type. [class.temporary] describes the lifetime of temporary objects. The third context is when a reference is bound to a temporary. A template argument may be a class template or alias template. Friend declarations shall not declare partial specializations. The class condition_variable shall be a standard-layout class. Implementations could decide to store references in a wrapper. A target object is the callable object held by a call wrapper. A clock shall meet the requirements in Table [tab:time.clock]. A name with global namespace scope is said to be a global name. The lifetime of a reference ends as if it were a scalar object. An anonymous union shall not have private or protected members. Declarations generally specify how names are to be interpreted. A default argument shall not be specified for a parameter pack. If a function is explicitly defaulted on its first declaration, Argument passing and function value return are initializations. Class error_code is an adjunct to error reporting by exception. An expression can result in a value and can cause side effects. A string literal is an lvalue; all other literals are prvalues. The left-hand side of the dot operator shall be of scalar type. The pointer-to-member operators ->* and .* group left-to-right. The result of the binary + operator is the sum of the operands. An object has a storage duration which influences its lifetime. Some behavior is specified as being operating system dependent. The overloaded function name can be preceded by the & operator. Despite the name, a non-directive is a preprocessing directive. A preprocessing directive of the form # new-line has no effect. invoking delete on a null pointer does not call the destructor. All forms of copy/move constructor may be declared for a class. The decl-specifier-seq shall not define a class or enumeration. The only use of an identifier label is as the target of a goto. A label can be used in a goto statement before its declaration. The decl-specifier-seq shall not define a class or enumeration. Types shall not be defined in a template-parameter declaration. The mutex types shall be DefaultConstructible and Destructible. A default-constructed shared_future object has no shared state. Each bit represents either the value zero (reset) or one (set). The template parameter T of weak_ptr may be an incomplete type. Overload resolution takes place after name lookup has succeeded. Template allocation functions shall have two or more parameters. The result of a glvalue is the entity denoted by the expression. A class-specifier is commonly referred to as a class definition. There are no special member function types or data member types. Containers with compatible nodes have the same node handle type. The friend specifier is used to specify access to class members. The operand of the decltype specifier is an unevaluated operand. A type can also be named (often more easily) by using a typedef. A literal is a primary expression. Its type depends on its form. For an expression of the form T(), T shall not be an array type. Use of an encoded character type implies an associated encoding. Template argument requirements are sometimes referenced by name. The implementation may ignore distinctions of alphabetical case. The identifier shall be a label located in the current function. A template-argument followed by an ellipsis is a pack expansion. The signature of a function template is defined in [intro.defs]. The timed mutex types shall meet the TimedLockable requirements. Every name that denotes an entity is introduced by a declaration. A constructor for a class is odr-used as specified in [dcl.init]. If a name is in scope and is not hidden it is said to be visible. An attribute-specifier that contains no attributes has no effect. A class is abstract if it has at least one pure virtual function. only class members declared prior to the declaration are visible. An entity is captured if it is captured explicitly or implicitly. The fundamental storage unit in the C++ memory model is the byte. The backward traversal order is the reverse of forward traversal. operator* provides access to the current input character, if any. The effect of attempting to modify a string literal is undefined. For the facet codecvt_utf8_utf16: See also: ISO/IEC 10646-1:1993. Macro definitions have no significance after translation phase 4. A non-explicit copy/move constructor is a converting constructor. The supplied Mutex type shall meet the shared mutex requirements. The template parameter T of unique_ptr may be an incomplete type. The template parameter T of shared_ptr may be an incomplete type. A callable type is a function object type or a pointer to member. A destructor for a class is odr-used if it is potentially invoked. the name is instead considered to name the constructor of class C. Some global allocation and deallocation functions are replaceable. A class is a type. Its name becomes a class-name within its scope. A POD class is a class that is either a POD struct or a POD union. A non-static member function may be declared with a ref-qualifier. unordered_multiset and unordered_multimap support equivalent keys. A name declared with the typedef specifier becomes a typedef-name. Each cv-qualifier shall appear at most once in a cv-qualifier-seq. An initializer-clause followed by an ellipsis is a pack expansion. For convenience we say that any virtual function overrides itself. The intention is to prevent lambdas from appearing in a signature. C++03 gives no meaning to the combination of fixed and scientific. Two kinds of implementations are defined: hosted and freestanding. Calling the set_* and get_* functions shall not incur a data race. Every implementation shall document those limitations where known. Declarations can appear in the substatement of a switch-statement. The macro NULL is an implementation-defined null pointer constant. Copying an initializer list does not copy the underlying elements. A local class of non-closure type shall not have member templates. A function template defines an unbounded set of related functions. The result of an infinite recursion in instantiation is undefined. The supplied Mutex type shall meet the BasicLockable requirements. The library provides a template for heterogeneous pairs of values. There are two kinds of types: fundamental types and compound types. Incompletely-defined object types and cv void are incomplete types. There are no signed, unsigned, short, or long bool types or values. A typedef-name shall not be used as the identifier in a class-head. A function defined within a class definition is an inline function. The inline specifier shall not appear on a block scope declaration. The underlying type can be explicitly specified using an enum-base. this implies that the name of the class or function is unqualified. There shall not be more initializers than there are array elements. The intent is to remain in close alignment with the POSIX standard. directory_iterator satisfies the requirements of an input iterator. Implementations should provide one global locale object per thread. Any pragma that is not recognized by the implementation is ignored. The typeid operator can be used during construction or destruction. A friend template may be declared within a class or class template. An explicit specialization declaration is introduced by template<>. A program consists of one or more translation units linked together. A pointer to objects of type T is referred to as a ``pointer to T''. The value representation of pointer types is implementation-defined. Every alignment value shall be a non-negative integral power of two. A specialization of a member function template is a member function. The bit-field attribute is not part of the type of the class member. Associative containers provide fast retrieval of data based on keys. For associative containers, no clear() function throws an exception. An array satisfies some of the requirements of a sequence container. Two null member pointer values of the same type shall compare equal. The set of declarations found by the transitive search is unordered. In a declaration T D the decl-specifier-seq T determines the type T. A DAG of subobjects is often referred to as a ``subobject lattice.'' Integral promotion is performed on integral or enumeration operands. The filename dot is treated as a reference to the current directory. An identifier is an arbitrarily long sequence of letters and digits. A UTF-8 character literal containing multiple c-chars is ill-formed. There is no limit to the number of digits in a hexadecimal sequence. Several types defined in Clause [input.output] are enumerated types. The implementation will implicitly define them if they are odr-used. A conversion function template shall not have a deduced return type. A variable template at class scope is a static data member template. Friend classes or functions can be declared within a class template. The instantiated default argument is then used as the argument of f. OUTERMOST(x) and OUTERMOST_ALLOC_TRAITS(x) are recursive operations. A class specifies its friends, if any, by way of friend declarations. The main function shall not be declared with a linkage-specification. There are three floating point types: float, double, and long double. Integral and floating types are collectively called arithmetic types. A non-static member function may be declared virtual or pure virtual. The rules described in [class.mfct] apply to static member functions. The identifier in a sizeof... expression shall name a parameter pack. The result of sizeof and sizeof... is a constant of type std::size_t. A string-literal that has an R in the prefix is a raw string literal. A function declared with a literal-operator-id is a literal operator. User-defined conversions are applied only where they are unambiguous. Case labels and default labels shall occur only in switch statements. An explicit instantiation declaration begins with the extern keyword. A thread object uniquely represents a particular thread of execution. The template parameter T of default_delete may be an incomplete type. The Boyer-Moore searcher implements the Boyer-Moore search algorithm. For non-random access iterators they execute a linear number of steps. A virt-specifier-seq shall contain at most one of each virt-specifier. A deque is a sequence container that supports random access iterators. The outermost declarative region of a translation unit is a namespace. If present, a ... handler shall be the last handler for its try block. A class-name or decltype-specifier prefixed by ~ denotes a destructor. The properties of an object are determined when the object is created. If j is reachable from i, they refer to elements of the same sequence. Interface convention requirements are stated as generally as possible. [contents] describes the entities defined in the C++ standard library. The character string literal corresponding to an empty argument is "". An object of class type can also be initialized by a braced-init-list. Calls to the POSIX functions setenv and putenv modify the environment. A template-parameter of the form class identifier is a type-parameter. The injected-class-name can be used as a template-name or a type-name. A template parameter used in a non-deduced context is considered used. The declarative region of a namespace-definition is its namespace-body. The lifetime of a reference begins when its initialization is complete. [class.base.init] describes the lifetime of base and member subobjects. A member shall not be declared with the extern storage-class-specifier. If an exception is thrown during insert_after there shall be no effect. Each enumeration defines a type that is different from all other types. A function with a deleted definition is also called a deleted function. An exception specification is not considered part of a function's type. If the last hard link to a file is removed, the file itself is removed. The filename dot-dot is treated as a reference to the parent directory. The library never assumes that past-the-end values are dereferenceable. An end-of-stream iterator is not equal to a non-end-of-stream iterator. A default-initialized object of type P may have an indeterminate value. Operations involving indeterminate values may cause undefined behavior. Objects of types defined in the C++ standard library may be moved from. The locale member function templates verify its type and storage class. Programs shall not define implicitly-declared special member functions. overloading of the assignment operator has no effect on initialization. The functions strerror and strtok are not required to avoid data races. typename followed by an unqualified-id names a template type parameter. A default template-argument may be specified in a template declaration. A template-parameter shall not have the same name as the template name. Constant nullopt shall be initialized with an argument of literal type. A duration type measures time between two points in time (time_points). A type having an extended alignment requirement is an over-aligned type. Alignments have an order from weaker to stronger or stricter alignments. Bit-fields straddle allocation units on some machines and not on others. At most one function with a particular name can have C language linkage. No attribute-specifier-seq shall appertain to an explicit instantiation. A reference shall be initialized to refer to a valid object or function. Overloaded operators are never assumed to be associative or commutative. Table [tab:lex.string.concat] has some examples of valid concatenations. [hash.requirements] describes the requirements on hash function objects. A NullablePointer type is a pointer-like type that supports null values. An allocator type X shall satisfy the requirements of CopyConstructible. Some literal suffix identifiers are reserved for future standardization. Implementations necessarily have some delay in returning from a timeout. high_resolution_clock may be a synonym for system_clock or steady_clock. Members of a class defined with the keyword class are private by default. Name lookup associates the use of a name with a declaration of that name. A data member is a non-function member introduced by a member-declarator. Allocation of bit-fields within a class object is implementation-defined. The simple-type-specifier auto is a placeholder for a type to be deduced. An entity is considered marked after the first declaration that marks it. An initializer for a static member is in the scope of the member's class. An exception-specification can also include the class std::bad_exception. An identifier is an id-expression provided it has been suitably declared. The postfix expression shall have function type or function pointer type. The expression E1->*E2 is converted into the equivalent form (*(E1)).*E2. The term object type refers to the type with which the object is created. A value-initialized object of type P produces the null value of the type. The identifier immediately following the define is called the macro name. An object of class type (or array thereof) can be explicitly initialized. Odr-uses in a discarded statement do not require an entity to be defined. The expr-or-braced-init-list of a return statement is called its operand. A template-id that names an alias template specialization is a type-name. An explicit specialization declaration shall not be a friend declaration. A lock does not manage the lifetime of the lockable object it references. Condition variable construction and destruction need not be synchronized. The shared_ptr class template stores a pointer, usually obtained via new. It is implementation-defined whether any extended alignment is supported. The origin of the clock's time_point is referred to as the clock's epoch. A specialization of a static data member template is a static data member. There may be more than one inline member function definition in a program. The algorithm lexicographical_compare() is defined in Clause [algorithms]. The object of type Compare is called the comparison object of a container. Virtual functions support dynamic binding and object-oriented programming. A braced-init-list shall not be used with the built-in subscript operator. const_cast is not limited to conversions that cast away a const-qualifier. Usually the execution can be viewed as an interleaving of all its threads. Template parameters named Allocator shall meet the Allocator requirements. [allocator.requirements] describes the requirements on storage allocators. A valid C++ program always calls the expected library non-member function. The classes num_get<> and num_put<> handle numeric formatting and parsing. An implicitly-declared default constructor has an exception specification. User-defined conversions are used implicitly only if they are unambiguous. An implicitly-declared destructor is an inline public member of its class. A non-type non-reference template-parameter cannot have its address taken. cv_1,n-1 ``pointer to'' cv_1,nT1 and P is a type cv_2,0 ``pointer to ...'' It is implementation-defined whether placeholder types are CopyAssignable. The function atomic_is_lock_free indicates whether the object is lock-free. The value representation of floating-point types is implementation-defined. A bool value can successfully be stored in a bit-field of any nonzero size. The keyword this may not appear in a default argument of a member function. A derived class can itself serve as a base class subject to access control. Ambiguities can often be resolved by qualifying a name with its class name. Lambda expressions provide a concise way to create simple function objects. Unary left folds and unary right folds are collectively called unary folds. The cast-expression in a delete-expression shall be evaluated exactly once. An alignof expression yields the alignment requirement of its operand type. For class objects, assignment is not in general the same as initialization. The set of alternative tokens is defined in Table [tab:alternative.tokens]. A destructor can be invoked for a const, volatile or const volatile object. More than one form of copy assignment operator may be declared for a class. More than one form of move assignment operator may be declared for a class. A storage class shall not be specified in a template-parameter declaration. A class instantiated from a class template is called an instantiated class. C++ differs from C in requiring a zero request to return a non-null pointer. A deallocation function template shall have two or more function parameters. It is implementation-defined whether a char object can hold negative values. At most one variant member of a union may have a default member initializer. begin() returns an iterator referring to the first element in the container. The effect of calling front() or back() for a zero-sized array is undefined. A function declaration with an inline specifier declares an inline function. A variable declaration with an inline specifier declares an inline variable. A using-declaration that names a class member shall be a member-declaration. Any attribute-token that is not recognized by the implementation is ignored. A declarator that specifies the type ``reference to cv void'' is ill-formed. [class.temporary] describes the lifetime of temporaries bound to references. Stream buffers can impose various constraints on the sequences they control. The class template basic_filebuf treats a file as a source or sink of bytes. A hard link can be thought of as a shared-ownership smart pointer to a file. The end iterator is not dereferenceable. Two end iterators are always equal. For an iterator type X there must be an instantiation of iterator_traits. The export and register keywords are unused but are reserved for future use. Table [tab:desc.var.def] describes the types manipulated through allocators. Class messages implements retrieval of strings from message catalogs. operator[] shall be a non-static member function with exactly one parameter. A constructor can be invoked for a const, volatile or const volatile object. Partial specialization declarations themselves are not found by name lookup. A type template-argument is dependent if the type it specifies is dependent. is_bind_expression can be used to detect function objects generated by bind. In a two's complement representation, this excludes the most negative value. Atomic operations that are not lock-free are considered to potentially block. A class name can also be implicitly declared by an elaborated-type-specifier. It is recommended that any further (optional) parameters be added after argv. The allocation function attempts to allocate the requested amount of storage. Class-specifiers and elaborated-type-specifiers are used to make class-names. Complete objects and member subobjects of class type shall have nonzero size. Previously declared member functions may be mentioned in friend declarations. For a map the key_type is Key and the value_type is pair. In a named-namespace-definition, the identifier is the name of the namespace. A fallthrough statement may only appear within an enclosing switch statement. Default arguments will be used in calls where trailing arguments are missing. A cv-qualifier-seq affects the type of this in the body of a member function. Assignment to a reference assigns to the object referred to by the reference. The form [&,this] is redundant but accepted for compatibility with ISO C++14. parentheses in a new-type-id of a new-expression can have surprising effects. Each mutex acquisition ``reads the value written'' by the last mutex release. The maximum number of elements in the sequence is operating system dependent. Path iterators iterate over the elements of pathstring in the generic format. A translation unit shall not declare namespace std to be an inline namespace. The symbol decimal-point indicates the character returned by decimal_point(). Non-static member functions match targets of pointer to member function type. some language constructs have special semantics when used during destruction. Labels have their own name space and do not interfere with other identifiers. A missing condition makes the implied while clause equivalent to while(true). A basic_string is a contiguous container. In all cases, size() <= capacity(). [temp.point] defines the point of instantiation of a template specialization. The library provides a class template that can represent an integer sequence. The rules for name lookup in template definitions are described in [temp.res]. Linkage to non-C++ declarations can be achieved using a linkage-specification. Member functions of a class in namespace scope have the linkage of that class. The member function at() provides bounds-checked access to container elements. The elements of an unordered associative container are organized into buckets. For unordered associative containers, no clear() function throws an exception. The auto type-specifier is also used to introduce a decomposition declaration. In a using-declaration that names a constructor, no access check is performed. If the parameter-declaration-clause is empty, the function takes no arguments. A reference cannot be changed to refer to another object after initialization. The operators == and != both yield true or false, i.e., a result of type bool. The operators new[], delete[], (), and [] are formed from more than one token. Programs may explicitly refer to implicitly-declared special member functions. some language constructs have special semantics when used during construction. A ctor-initializer may initialize a variant member of the constructor's class. An overloaded assignment operator must be declared to have only one parameter. An overloaded assignment operator must be declared to have only one parameter. The template parameter T of enable_shared_from_this may be an incomplete type. Any number of access specifiers is allowed and no particular order is required. the thread of execution will continue to do so until the algorithm is finished. For a discarded prvalue, a temporary object is materialized; see Clause [expr]. iterator of an associative container is of the bidirectional iterator category. It is unspecified whether or not iterator and const_iterator are the same type. It is unspecified whether or not iterator and const_iterator are the same type. The linkages implied by successive declarations for a given entity shall agree. Unlike the preceding rule, parentheses have no special meaning in this context. A variable whose declared type is ``reference to type T'' shall be initialized. A type cv T denoted in a dynamic-exception-specification is adjusted to type T. The expression in a noptr-new-declaratoris implicitly converted to std::size_t. Specific filenames may have special meanings for a particular operating system. The forward slash ('/') character is used as the directory-separator character. The effect of dereferencing an iterator that has been invalidated is undefined. A string-literal that begins with L, such as L"asdf", is a wide string literal. A specialization of an operator function template is also an operator function. An expression statement with the expression missing is called a null statement. The class type_info describes type information generated by the implementation. An appearance of a name of a parameter pack that is not expanded is ill-formed. A thread of execution is detached when no thread object represents that thread. The standard library type std::shared_timed_mutex is a shared timed mutex type. class bad_optional_access : public logic_error public: bad_optional_access(); ; A duration has a representation which holds a count of ticks and a tick period. A member of a class can also access all the names to which the class has access. initialization by a trivial copy/move constructor is non-vacuous initialization. Reading a volatile object through a non-volatile glvalue has undefined behavior. Bit-fields are assigned right-to-left on some machines, left-to-right on others. If no initializer is specified for an object, the object is default-initialized. The use of more than one direct base class is often called multiple inheritance. Name lookup can result in an ambiguity, in which case the program is ill-formed. The presence of parentheses does not affect whether the expression is an lvalue. In a unary fold, the cast-expression shall contain an unexpanded parameter pack. The operand of postfix -- is decremented analogously to the postfix ++ operator. The result of the noexcept operator is a constant of type bool and is a prvalue. the comma operator as described in Clause [expr] can appear only in parentheses. A sequence of elements that identify the location of a file within a filesystem. If the set of candidate functions is empty, overload resolution is unsuccessful. Overload resolution is used to select the user-defined conversion to be invoked. A simple-template-id that names a class template specialization is a class-name. A template-argument for a template-parameter which is a type shall be a type-id. A friend declaration may first declare a member of an enclosing namespace scope. Like normal (non-template) classes, class templates have an injected-class-name. The defaulted move and copy constructor of tuple<> shall be constexpr functions. Type nullopt_t shall not have a default constructor. It shall be a literal type. A type mentioned in [basic.fundamental, basic.compound] is a cv-unqualified type. Expressions are categorized according to the taxonomy in Figure [fig:categories]. The result of a prvalue is the value that the expression stores into its context. An lvalue is modifiable unless its type is const-qualified or is a function type. There can be at most one definition of a non-inline member function in a program. Static data members of a class in namespace scope have the linkage of that class. vector or array is the type of sequence container that should be used by default. For any key k in a container, calling hash(k) shall always return the same value. The extern specifier can be applied only to the names of variables and functions. The template-name shall name a class template that is not an injected-class-name. A declarator declares a single variable, function, or type, within a declaration. As described in [class.bit], a reference cannot be bound directly to a bit-field. A bit-field or a member of an anonymous union shall not be captured by reference. Assignment to objects of a class is defined by the copy/move assignment operator. For classes and class templates, the library Clauses specify partial definitions. The type of a floating literal is double unless explicitly specified by a suffix. A return statement in the body of a constructor shall not specify a return value. The implicitly-declared move constructor for class X will have the form X::X(X&&) There shall be at most one label of the form default : within a switch statement. An explicit instantiation shall appear in an enclosing namespace of its template. If a substitution results in an invalid type or expression, type deduction fails. is_placeholder can be used to detect the standard placeholders _1, _2, and so on. The dynamic storage duration is associated with objects created with operator new. For a type cv T, the top-level cv-qualifiers of that type are those denoted by cv. A static member function shall not be declared const, volatile, or const volatile. The iterator returned from a.insert(p, t) points to the copy of t inserted into a. The exceptions are the operator[] and at member functions, which are not provided. For a multimap the key_type is Key and the value_type is pair. A declaration occurs in a scope; the scope rules are summarized in [basic.lookup]. Clause [expr] defines the syntax, order of evaluation, and meaning of expressions. A lambda-expression is a prvalue whose result object is called the closure object. indirection through a pointer to an incomplete type (other than cv void) is valid. An object that is not a subobject of any other object is called a complete object. Implementations are encouraged to provide such behavior as it is defined by POSIX. Iterators can also have singular values that are not associated with any sequence. The template parameter Iterator shall meet the requirements for an Input Iterator. A string-literal that begins with u8, such as u8"asdf", is a UTF-8 string literal. The namespace posix is reserved for use by ISO/IEC 9945 and other POSIX standards. Operator functions are inherited in the same manner as other base class functions. Non-arithmetic standard types, such as complex, shall not have specializations. A parameter pack is either a template parameter pack or a function parameter pack. A member or a member template may be nested within many enclosing class templates. The class mutex provides a non-recursive mutex with exclusive ownership semantics. It is unspecified how many levels of ownership may be acquired by a single thread. It is unspecified how many levels of ownership may be acquired by a single thread. An asynchronous return object is an object that reads results from a shared state. Changes in use_count() do not reflect modifications that can introduce data races. The meaning of the arguments of type memory_order is explained in [atomics.order]. CopyAssignable placeholders' copy assignment operators shall not throw exceptions. Members of a class defined with the keywords struct or union are public by default. Static data members are initialized and destroyed exactly like non-local variables. Each non-static data member is allocated as if it were the sole member of a struct. A prvalue of an integer type can be converted to a prvalue of another integer type. A simple-declaration with an identifier-list is called a decomposition declaration. A class that declares or inherits a virtual function is called a polymorphic class. A virtual function declared in one class can be declared a friend in another class. An exception is considered caught when a handler for that exception becomes active. An expression is a sequence of operators and operands that specifies a computation. A subobject can be a member subobject, a base class subobject, or an array element. The execution of the entire program consists of an execution of all of its threads. The operating system an implementation is dependent upon is implementation-defined. A string-literal that begins with u, such as u"asdf", is a char16_t string literal. A string-literal that begins with U, such as U"asdf", is a char32_t string literal. The pointer literal is the keyword nullptr. It is a prvalue of type std::nullptr_t. The regular expressions library provides regular expression matching and searching. An implementation may use any technique that provides equivalent external behavior. [headers] lists the standard library headers and some constraints on those headers. Literal operators and literal operator templates shall not have C language linkage. An implicitly-declared default constructor is an inline public member of its class. The initialization performed by each mem-initializer constitutes a full-expression. There is no semantic difference between class and typename in a type-parameter-key. The keyword template may not be applied to non-template members of class templates. The primary template shall be declared before any specializations of that template. Each deallocation function shall return void and its first parameter shall be void*. A prvalue whose result is the value V is sometimes said to have or name the value V. A standard-layout union is a standard-layout class defined with the class-key union. An unnamed bit-field is useful for padding to conform to externally-imposed layouts. The iterator returned from a.insert(p, rv) points to the copy of rv inserted into a. A standard conversion sequence can be empty, i.e., it can consist of no conversions. A prvalue of a floating point type can be converted to a prvalue of an integer type. The decl-specifier-seq shall contain only the type-specifier auto and cv-qualifiers. The optional attribute-specifier-seq in an enumerator appertains to that enumerator. Every namespace-definition shall appear in the global scope or in a namespace scope. When linkage specifications nest, the innermost one determines the language linkage. For each individual attribute, the form of the balanced-token-seq will be specified. Declarations in different scopes have completely distinct sets of default arguments. Implementations should leave the error states provided by other libraries unchanged. because references are not objects, references cannot be created by new-expressions. The templates, classes, functions, and objects in the library have external linkage. If A and B would not otherwise be sequenced then they are indeterminately sequenced. The string returned by all native format observers is in the native pathname format. Each preprocessing-op-or-punc is converted to a single token in translation phase 7. The original four preprocessing tokens in the unary operator expression are removed. the notation for explicit call of a destructor can be used for any scalar type name. An implicitly-declared copy/move constructor has an implied exception specification. Most statements are expression statements --- usually assignments or function calls. A member of a class template may be declared to be a friend of a non-template class. A function instantiated from a function template is called an instantiated function. The finest resolution provided by an implementation is called the native resolution. namespace std template struct default_order using type = less; ; The size and layout of an instance of an incompletely-defined object type is unknown. Constructors and destructors shall not be declared const, volatile or const volatile. A non-template function is a function that is not a function template specialization. Constructors of a base class can also be inherited as described in [namespace.udecl]. Initialization of objects representing base classes can be specified in constructors. Member name lookup determines the meaning of a name (id-expression) in a class scope. Explicit qualification with the scope operator suppresses the virtual call mechanism. An implementation shall not add members of rvalue reference type to the closure type. A value of a scoped enumeration type can be explicitly converted to an integral type. A new-expression may obtain storage for the object by calling an allocation function. A full-expression is an expression that is not a subexpression of another expression. The operating system dependent pathname format accepted by the host operating system. The random number component provides facilities for generating pseudo-random numbers. Certain container class member function signatures specify T() as a default argument. Destructor operations defined in the C++ standard library shall not throw exceptions. Class locale implements a type-safe polymorphic set of facets, indexed by facet type. The header provides code conversion facets for various character encodings. Any redundant set of parentheses surrounding the overloaded function name is ignored. Any assignment operator, even the copy and move assignment operators, can be virtual. Since member allocation and deallocation functions are static they cannot be virtual. Destructors for the array elements are called in reverse order of their construction. An implicitly-declared copy/move constructor is an inline public member of its class. Knowing which names are type names allows the syntax of every template to be checked. A forwarding reference is an rvalue reference to a cv-unqualified template parameter. A shared state is ready only if it holds a value or an exception ready for retrieval. The type unique_ptr::pointer shall satisfy the requirements of NullablePointer. The members of pool_options comprise a set of constructor options for pool resources. The function class template is a call wrapper whose call signature is R(ArgTypes...). A nested class is a member and as such has the same access rights as any other member. The type of a pointer that can designate a function is called a function pointer type. A declaration for a bit-field that omits the identifier declares an unnamed bit-field. A map also provides most operations described in [associative.reqmts] for unique keys. A set also provides most operations described in [associative.reqmts] for unique keys. The inline namespace set of N is the transitive closure of all inline namespaces in N. No name lookup is performed on any of the identifiers contained in an attribute-token. Name lookup takes place before access control~([basic.lookup], Clause [class.access]). A fold expression performs a fold of a template parameter pack over a binary operator. cv represents an arbitrary set of cv-qualifiers, as defined in [basic.type.qualifier]. A value of integral type or enumeration type can be explicitly converted to a pointer. Constructors are provided that store zero, one, or two paths associated with an error. A temporary expression bound to a reference member in a mem-initializer is ill-formed. The requirements on conditions in iteration statements are described in [stmt.select]. A template defines a family of classes or functions or an alias for a family of types. A placeholder type in the return type of a function template is a non-deduced context. The class shared_mutex provides a non-recursive mutex with shared ownership semantics. Objects of class high_resolution_clock represent clocks with the shortest tick period. Static initialization shall be performed before any dynamic initialization takes place. The value representation of an object is the set of bits that hold the value of type T. Unless otherwise indicated, a prvalue shall always have complete type or the void type. A non-static data member of non-reference type is a member subobject of a class object. A virt-specifier-seq shall appear only in the declaration of a virtual member function. A storage class is not allowed in a declaration of an anonymous union in a class scope. The behavior of splice operations is undefined if get_allocator() != x.get_allocator(). Certain language constructs require that an expression be converted to a Boolean value. The thread_local specifier indicates that the named entity has thread storage duration. The order in which the attribute-tokens appear in an attribute-list is not significant. An ambiguity can arise from the similarity between a function-style cast and a type-id. The implicit odr-use of a virtual function does not, by itself, constitute a reference. All side effects of argument evaluations are sequenced before the function is entered . A value of floating-point type can also be explicitly converted to an enumeration type. An object pointer can be explicitly converted to an object pointer of a different type. Certain library calls synchronize with other library calls performed by another thread. The elements of a path that determine if it is absolute are operating system dependent. The elements of a path that determine if it is relative are operating system dependent. A range is a pair of iterators that designate the beginning and end of the computation. Bidirectional iterators allow algorithms to move iterators backward as well as forward. The program's declarations shall not be specified as inline. No diagnostic is required. Every standard library function shall meet each requirement unless otherwise specified. A function template declared with a literal-operator-id is a literal operator template. The two-argument member assign shall be defined identically to the built-in operator =. A template-declaration can appear only as a namespace scope or class scope declaration. this is type-dependent if the class type of the enclosing member function is dependent. An object of type lock_guard controls the ownership of lockable objects within a scope. The Boyer-Moore-Horspool searcher implements the Boyer-Moore-Horspool search algorithm. Access control applies to names nominated by friend declarations and using-declarations. The interpretation of a given construct is established without regard to access control. [basic.lookup.classref] describes how name lookup proceeds after the . and -> operators. The keyword static can be used to declare a local variable with static storage duration. Allocation and/or deallocation functions may also be declared and defined for any class. A template instance is never a usual deallocation function, regardless of its signature. The lifetime of an object or reference is a runtime property of the object or reference. A member function can be declared (but not defined) using a typedef for a function type. The size of a union is sufficient to contain the largest of its non-static data members. A union-like class is a union or a class that has an anonymous union as a direct member. The header defines a class template for storing fixed-size sequences of objects. The optional identifier shall not be omitted in the declaration of a scoped enumeration. A declaration can be explicitly disambiguated by adding parentheses around the argument. List-initialization is initialization of an object or reference from a braced-init-list. A class shall not be specified as a direct base class of a derived class more than once. The new-type-id in a new-expression is the longest possible sequence of new-declarators. An implementation is allowed to omit a call to a replaceable global allocation function. The value of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are zero-filled. Annex [implimits] recommends lower bounds on the capacity of conforming implementations. Every thread in a program can potentially access every object and function in a program. Behavior that is dependent upon the behavior and characteristics of an operating system. Unless otherwise specified, objects and functions have the default extern "C++" linkage. The class template allocator_traits supplies a uniform interface to all allocator types. A C++ header shall provide the declarations and definitions that appear in its synopsis. istream members are required to use ctype<> for character classing during input parsing. Different versions of an overloaded member function can be given different access rules. If that user-written default constructor would be ill-formed, the program is ill-formed. Destructors for elements of an array are called in reverse order of their construction . Once the target constructor returns, the body of the delegating constructor is executed. The complexity of basic_string_view member functions is O(1) unless otherwise specified. initializer_list is used to implement initializer lists as specified in [dcl.init.list]. A declaration introduced by a template declaration of a variable is a variable template. A template-parameter shall not be redeclared within its scope (including nested scopes). The parameters of function template specializations contain no template parameter types. Objects of class thread can be in a state that does not represent a thread of execution. The class recursive_mutex provides a recursive mutex with exclusive ownership semantics. The class timed_mutex provides a non-recursive mutex with exclusive ownership semantics. The class template allocator_traits supplies a uniform interface to all allocator types. Algorithms that take predicates end with the suffix _if (which follows the suffix _copy). The enumerators of an unscoped enumeration defined in the class are members of the class. Declarations of other static data members shall not specify a brace-or-equal-initializer. If a union contains a non-static data member of reference type the program is ill-formed. The signed specifier forces char objects to be signed; it is redundant in other contexts. A function declared with a return type that uses a placeholder type shall not be virtual. A using-directive does not add any members to the declarative region in which it appears. A parameter shall not appear as a potentially-evaluated expression in a default argument. The optional attribute-specifier-seq in a function-definition appertains to the function. Unused parameters need not be named. For example, void print(int a, int) std::printf("a = Initializer-list constructors are favored over other constructors in list-initialization. A base class specifier that contains the keyword virtual, specifies a virtual base class. An exception can have active handlers and still be considered uncaught if it is rethrown. A function pointer can be explicitly converted to a function pointer of a different type. Indeterminately sequenced evaluations cannot overlap, but either could be executed first. What the filename dot-dot refers to relative to root-directory is implementation-defined. The result of the application of functions in the library to invalid ranges is undefined. Some generic algorithms can be called with move iterators to replace copying with moving. Two non-end-of-stream iterators are equal when they are constructed from the same stream. The term describes a type to which a reference can be created, including reference types. Certain functions in the C++ standard library report errors via a std::error_code object. A locally declared function is not in the same scope as a function in a containing scope. An operator function is said to implement the operator named in its operator-function-id. The string literal of a #line directive, if present, shall be a character string literal. typename followed by a qualified-id denotes the type in a non-type parameter-declaration. A class template defines the layout and operations for an unbounded set of related types. A template type-parameter cannot be deduced from the type of a function default argument. The delay durations may vary from timeout to timeout, but in all cases shorter is better. An object of type unique_lock controls the ownership of a lockable object within a scope. Instantiations of the is_placeholder template shall meet the UnaryTypeTrait requirements. No storage-class-specifier shall appear in the decl-specifier-seq of a friend declaration. The point of declaration for an enumerator is immediately after its enumerator-definition. The notions of scope, point of declaration and name hiding are discussed in [basic.scope]. If a deallocation function terminates by throwing an exception, the behavior is undefined. The storage duration of subobjects and reference members is that of their complete object. A union for which objects, pointers, or references are declared is not an anonymous union. A multimap also provides most operations described in [associative.reqmts] for equal keys. In general, the semantics of volatile are intended to be the same in C++ as they are in C. The rules for determining types involving decltype(auto) are specified in [dcl.spec.auto]. An opaque-enum-declaration declaring an unscoped enumeration shall not omit the enum-base. A declarator contains exactly one declarator-id; it names the identifier that is declared. The subobjects are destroyed in the reverse order of the completion of their construction. Two exception-specifications are compatible if the sets of types they denote are the same. A postfix expression followed by an expression in square brackets is a postfix expression. When alignof is applied to an array type, the result is the alignment of the element type. Abbreviating pm-expression.*cast-expression as E1.*E2, E1 is called the object expression. The assignment operator (=) and the compound assignment operators all group right-to-left. The operating system interface described in ISO/IEC 9945:2003 is hereinafter called POSIX. The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. Each formatted output function begins execution by constructing an object of class sentry. An object of type file_status stores information about the type and permissions of a file. Values of an iterator i for which the expression *i is defined are called dereferenceable. The radix point (but not the exponent) can be omitted from a hexadecimal floating literal. It is not possible to change the precedence, grouping, or number of operands of operators. The user-defined function called operator++ implements the prefix and postfix ++ operator. A defaulted move constructor that is defined as deleted is ignored by overload resolution. The default numeric_limits template shall have all members, but with 0 or false values. A default template-argument shall not be specified in a friend class template declaration. A deduction-guide shall be declared in the same scope as the corresponding class template. A program may deadlock if the thread that owns a mutex object calls lock() on that object. class bad_any_cast : public bad_cast public: const char* what() const noexcept override; ; A deleter's state need never be copied, only moved or swapped as ownership is transferred. The contents of the header are the same as the Standard C library header . A class member can be referred to using a qualified-id at any point in its potential scope. An elaborated-type-specifier can also be used as a type-specifier as part of a declaration. Nested types, anonymous unions, and functions cannot be declared within an anonymous union. A class can be declared within a function definition; such a class is called a local class. A prvalue of an unscoped enumeration type can be converted to a prvalue of an integer type. declarators, the components of an init-declarator-list, are described in Clause [dcl.decl]. Each function in a given set of overloaded functions can have a different linkage, however. If no integral type can represent all the enumerator values, the enumeration is ill-formed. Since the address of a bit-field cannot be taken, a pointer can never point to a bit-field. As indicated by syntax, cv-qualifiers are a significant component in function return types. An implicitly declared allocation or deallocation function shall not be defined as deleted. a class member can be referred to using a qualified-id at any point in its potential scope. The closure type associated with a lambda-expression has an implicitly-declared destructor. The operand of prefix ++ is modified by adding 1. The operand shall be a modifiable lvalue. The conversion might be ill-formed even if an implicit conversion sequence could be formed. If the encoded character type is EcharT, the null character can be constructed by EcharT(). The Summary provides a synopsis of the category, and introduces the first-level subclauses. No operation which is part of the NullablePointer requirements shall exit via an exception. For every type T there exist candidate operator functions of the form @T@* operator+(@T@*); Copy elision might not be performed if the same expression is evaluated in another context. No two of the case constants in the same switch shall have the same value after conversion. Relational operators allow thread::id objects to be used as keys in associative containers. A program is ill-formed if the definition of any object gives the object an incomplete type. The use of :: allows a global name to be referred to even if its identifier has been hidden. Variables with thread storage duration are initialized as a consequence of thread execution. It is implementation-defined whether an implementation has relaxed or strict pointer safety. The standard and extended signed integer types are collectively called signed integer types. An extended alignment is represented by an alignment greater than alignof(std::max_align_t). If a static data member is declared thread_local there is one copy of the member per thread. Initialization of unions with no user-declared constructors is described in [dcl.init.aggr]. An instance of array stores N elements of type T, so that size() == N is an invariant. multiset also provides most operations described in [associative.reqmts] for duplicate keys. [basic.type.qualifier, dcl.fct] describe how cv-qualifiers affect object and function types. Redundant cv-qualifications are ignored. For example, these could be introduced by typedefs. Declaring a variable const can affect its linkage and its usability in constant expressions. The optional attribute-specifier-seq in a parameter-declaration appertains to the parameter. Access checking applies to names in default arguments as described in Clause [class.access]. Whether or not the implementation exposes the macros is unspecified. In a dynamic-exception-specification, a type-id followed by an ellipsis is a pack expansion. The std::unexpected() function shall not return, but it can throw (or rethrow) an exception. A reinterpret_cast cannot be used to convert a value of any type to the type std::nullptr_t. Access and ambiguity control are done for both the deallocation function and the destructor. The memory available to a C++ program consists of one or more sequences of contiguous bytes. If an exception is thrown during input then ios::badbit is turned on in *this's error state. Each unformatted output function begins execution by constructing an object of class sentry. Implementations shall document any behavior that differs from the behavior defined by POSIX. For narrow character strings, the operating system dependent current encoding for pathnames. Value-initialized iterators behave as if they refer past the end of the same empty sequence. The template parameter Iterator shall meet all the requirements of a Bidirectional Iterator. A single c-char may produce more than one char16_t character in the form of surrogate pairs. The localization library provides extended internationalization support for text processing. The length of an ntbs is the number of elements that precede the terminating null character. Access to the facets of a locale is via two function templates, use_facet<> and has_facet<>. Class template wstring_convert performs conversions between a wide string and a byte string. The facet num_get is used to parse numeric values from an input sequence such as an istream. A parameter identifier in a function-like macro shall be uniquely declared within its scope. An implicitly-declared copy/move assignment operator has an implied exception specification. The top-level cv-qualifiers on the template-parameter are ignored when determining its type. The class shared_timed_mutex provides a non-recursive mutex with shared ownership semantics. An exception of type bad_weak_ptr is thrown by the shared_ptr constructor taking a weak_ptr. Objects of class system_clock represent wall clock time from the system-wide realtime clock. make_heap() converts a range into a heap and sort_heap() turns a heap into a sorted sequence. The effect of indirecting through a pointer returned as a request for zero size is undefined. Any cv-qualifiers applied to an array type affect the array element type, not the array type. Unordered associative containers provide an ability for fast retrieval of data based on keys. The worst-case complexity for most operations is linear, but the average case is much faster. Storage management is handled automatically, though hints can be given to improve efficiency. The type of a variable declared using auto or decltype(auto) is deduced from its initializer. There shall be no arrays of functions, although there can be arrays of pointers to functions. A virt-specifier-seq can be part of a function-definition only if it is a member-declaration. The precedence of operators is not directly specified, but it can be derived from the syntax. Uses of overloaded operators are transformed into function calls as described in [over.oper]. An expression of the form (... op e) where op is a fold-operator is called a unary left fold. If the header is not included prior to a use of typeid, the program is ill-formed. `Requires:' remove_all_extents_t shall be a complete type or (possibly cv-qualified) void. If A is not sequenced before B and B is not sequenced before A, then A and B are unsequenced. Specializations of the class template fpos are used for specifying file position information. For wide character strings, the implementation defined execution wide-character set encoding. A character literal that does not begin with u8, u, U, or L is an ordinary character literal. An ordinary character literal that contains more than one c-char is a multicharacter literal. A character literal that begins with the letter L, such as L'z', is a wide-character literal. Each element of the C++ standard library is declared or defined (as appropriate) in a header. If a class has no user-declared destructor, a destructor is implicitly declared as defaulted. An implicitly-declared copy/move assignment operator is an inline public member of its class. The header defines all macros the same as the C standard library header . The header defines all types and macros the same as the C standard library header . An object of type initializer_list provides access to an array of objects of type const E. A default template-argument is a template-argument specified after = in a template-parameter. A braced-init-list is type-dependent if any element is type-dependent or is a pack expansion. Implementations should decrease the duration of the wait when the clock is adjusted forwards. Instantiations of the is_bind_expression template shall meet the UnaryTypeTrait requirements. Atomic operations specifying memory_order_relaxed are relaxed with respect to memory ordering. A name declared in the global namespace has global namespace scope (also called global scope). [dcl.fct.default] further describes the restrictions on the use of names in default arguments. Variables with static storage duration are initialized as a consequence of program initiation. The library provides default definitions for the global allocation and deallocation functions. A prvalue of floating point type can be converted to a prvalue of another floating point type. It is possible to define an enumeration that has values not defined by any of its enumerators. A synonym created by a using-declaration has the usual accessibility for a member-declaration. A default argument shall not be redefined by a later declaration (not even to the same value). A local variable shall not appear as a potentially-evaluated expression in a default argument. Successive characters of the value of the string literal initialize the elements of the array. Members of a base class other than constructors are said to be inherited by the derived class. The Standard C++ library provides classes to be used to report certain errors in C++ programs. If a handler exits by rethrowing, control is passed to another handler for the same exception. In an explicit instantiation an exception-specification may be specified, but is not required. An expression of the form (e op ...) where op is a fold-operator is called a unary right fold. There is an ambiguity in the grammar when ~ is followed by a class-name or decltype-specifier. The elements are the root-name_opt, root-directory_opt, and an optional sequence of filenames. The domain of == for forward iterators is that of iterators over the same underlying sequence. The behavior of a program that applies operator++() to an end-of-stream iterator is undefined. [compliance] lists requirements for a freestanding implementation of the C++ standard library. Note A: The member class template rebind in the table above is effectively a typedef template. User-defined facets may be installed in a locale, and used identically as may standard facets. codecvt implements a degenerate conversion; it does not convert at all. The facet num_put is used to format numeric values to a character sequence such as an ostream. A template parameter indicates whether local or international monetary formats are to be used. The copy/move constructor is implicitly defined even if the implementation elided its odr-use. Class templates are instantiated as necessary to determine if a qualified name is a type-name. The contents of the header are the same as the C standard library header . The contents of the header are the same as the C standard library header . Each template parameter pack shall be expanded with an ellipsis in the template argument list. A primary class template declaration is one in which the class template name is an identifier. The usual access checking rules do not apply to names used to specify explicit instantiations. The class mutex shall satisfy all the Mutex requirements. It shall be a standard-layout class. The class recursive_timed_mutex provides a recursive mutex with exclusive ownership semantics. Labels have function scope and may be used anywhere in the function in which they are declared. [class.base.init] further describes the restrictions on the use of names in a ctor-initializer. An implementation shall not predefine the main function. This function shall not be overloaded. An object of a class consists of a (possibly empty) sequence of members and base class objects. The headers and define the container adaptors queue, priority_queue, and stack. decl-specifiers, the principal components of a decl-specifier-seq, are described in [dcl.spec]. The extern specifier cannot be used in the declaration of class members or function parameters. Two enumeration types are layout-compatible enumerations if they have the same underlying type. In an attribute-list, an ellipsis may appear only if that attribute's specification permits it. A class is an indirect base class of another if it is a base class but not a direct base class. The virtual specifier implies membership, so a virtual function cannot be a nonmember function. The class error_condition describes an object used to hold values identifying error conditions. A handler of type ``array of T'' or function type T is adjusted to be of type ``pointer to T''. The set of potential exceptions of an expression e is empty if e is a core constant expression. When a function is called, each parameter shall be initialized with its corresponding argument. The header defines types that control input from and output to character sequences. A user-defined-literal is treated as a call to a literal operator or literal operator template. The resolution of the address of an overload set in other contexts is described in [over.over]. When comparing the basic forms of implicit conversion sequences (as defined in [over.best.ics]) A raw literal operator is a literal operator with a single parameter whose type is const char*. For instance: #include #include #include "usefullib.h" #include "myprog.h" Type conversions of class objects can be specified by constructors and by conversion functions. An array of class type contains several subobjects for each of which the destructor is invoked. The class bad_exception defines the type of objects thrown as described in [except.unexpected]. An enumeration member of a class template may be defined outside the class template definition. A template parameter pack is a template parameter that accepts zero or more template arguments. A function parameter pack is a function parameter that accepts zero or more function arguments. An explicit specialization shall be declared in a namespace enclosing the specialized template. Template parameters named Hash shall meet the requirements as specified in [hash.requirements]. Every name that denotes a label is introduced either by a goto statement or a labeled-statement. [class.nest] further describes the restrictions on the use of names in nested class definitions. [class.local] further describes the restrictions on the use of names in local class definitions. [class.local] further describes the restrictions on the use of names in local class definitions. The standard and extended unsigned integer types are collectively called unsigned integer types. A union is a class defined with the class-key union; it holds at most one data member at a time. A typedef-name that names a class type, or a cv-qualified version thereof, is also a class-name. The order of allocation of non-static data members with different access control is unspecified. If k1 and k2 are equivalent, the container's hash function shall return the same value for both. list provides three splice operations that destructively move elements from one list to another. There can be no static function declarations within a block, nor any static function parameters. If a typedef specifier appears in a declaration without a declarator, the program is ill-formed. A typedef-name that names a class type, or a cv-qualified version thereof, is also a class-name. Cv-qualifiers are supported by the type system so that they cannot be subverted without casting. some conversions which involve only changes in cv-qualification cannot be done using const_cast. When alignof is applied to a reference type, the result is the alignment of the referenced type. Under a hosted implementation, a C++ program can have more than one thread running concurrently. The size of a char16_t string literal is the number of code units, not the number of characters. Member functions, including virtual functions, can be called during construction or destruction. The goto statement unconditionally transfers control to the statement labeled by the identifier. A non-type template-parameter shall not be declared to have floating point, class, or void type. A member class instantiated from a member class template is called an instantiated member class. The type of a type parameter is only deduced from an array bound if it is not otherwise deduced. The standard library types std::shared_mutex and std::shared_timed_mutex are shared mutex types. An object of type shared_lock controls the shared ownership of a lockable object within a scope. The decision whether to include a copying version was usually based on complexity considerations. [basic.scope.class] further describes the restrictions on the use of names in a class definition. The type of a pointer to cv void or a pointer to an object type is called an object pointer type. As an exception to the general rule, for a vector y, y[0] = true may race with y[1] = true. The library provides four basic kinds of associative containers: set, multiset, map and multimap. Member function swap() shall have a noexcept-specification which is equivalent to noexcept(true). Function types (including those used in pointer to member function types) are never cv-qualified. The conversions allowed as integral promotions are excluded from the set of integral conversions. The attribute-token determines additional requirements on the attribute-argument-clause (if any). Implementations are encouraged to issue a warning if a function marked [[noreturn]] might return. The nested-name-specifier of a qualified declarator-id shall not begin with a decltype-specifier. An object whose initializer is an empty set of parentheses, i.e., (), shall be value-initialized. In the case of an implicit class member access, the implied object is the one pointed to by this. The value of a failed cast to pointer type is the null pointer value of the required result type. Function types (including those used in pointer to member function types) are never cv-qualified. Converting a function pointer to an object pointer type or vice versa is conditionally-supported. The sizeof... operator yields the number of arguments provided for the parameter pack identifier. For functions, function templates, objects, and values, the library Clauses specify declarations. Implementations shall supply definitions consistent with the descriptions in the library Clauses. An object of trivially copyable or standard-layout type shall occupy contiguous bytes of storage. Operations specified in Table [tab:iostreams.position.requirements] are permitted. In that table, The value of preferred_separator is the operating system dependent preferred-separator character. Filesystem operation functions query or modify files, including directories, in external storage. Iterators that further satisfy the requirements of output iterators are called mutable iterators. There are five kinds of tokens: identifiers, keywords, literals, operators, and other separators. [swappable.requirements] describes the requirements on swappable types and swappable expressions. It is unspecified whether any member functions in the C++ standard library are defined as inline. The function selected by overload resolution is not guaranteed to be appropriate for the context. Each subexpression with type bool is subjected to integral promotion before processing continues. The implicitly-defined copy/move constructor for a union X copies the object representation of X. The address of an array element or non-static data member is not an acceptable template-argument. A specialization for any template may have points of instantiation in multiple translation units. If P has a form that contains [i], and if the type of i is not an integral type, deduction fails. Only when all levels of ownership have been released may ownership be acquired by another thread. Multiple execution agents can simultaneously hold a shared lock ownership of a shared mutex type. A single name can denote several member functions provided their types are sufficiently different. The initializer expression in the definition of a static data member is in the scope of its class. A null pointer constant is an integer literal with value zero or a prvalue of type std::nullptr_t. A nodeclspec-function-declaration shall declare a constructor, destructor, or conversion function. A typedef-name does not introduce a new type the way a class declaration or enum declaration does. Following the closing brace of an enum-specifier, each enumerator has the type of its enumeration. The attribute-token carries_dependency specifies dependency propagation into and out of functions. The attribute-token maybe_unused indicates that a name or entity is possibly intentionally unused. An object of array type contains a contiguously allocated non-empty set of N subobjects of type T. A function is said to allow all exceptions if its exception specification is the set of all types. The conversions performed by can be performed using the cast notation of explicit type conversion. The use of any of the C++ headers , , , or is deprecated. Once a thread of execution in S terminates, it is removed from S. Once S is empty, P is unblocked. Ideal behavior is not always implementable, so the conformance sub-clauses take that into account. Ordinary string literals and UTF-8 string literals are also referred to as narrow string literals. Named locales may be compared for equality; an unnamed locale is equal only to (copies of) itself. Formatting facets use the character argument fill to fill out the specified width where necessary. The moneypunct<> facet defines monetary formatting parameters used by money_get<> and money_put<>. During overload resolution, the implied object argument is indistinguishable from other arguments. Any allocation function for a class T is a static member (even if not explicitly declared static). A defaulted move assignment operator that is defined as deleted is ignored by overload resolution. All side effects from an expression statement are completed before the next statement is executed. The template arguments of a specialization are deduced from the arguments of the primary template. The type-id in an alias template declaration shall not refer to the alias template being declared. The usual qualified name lookup is used to find the qualified-id even in the presence of typename. Any instance of optional at any given time either contains a value or does not contain a value. The rules in [basic.lookup.argdep] have no effect on the syntactic interpretation of an expression. [class.nest] further describes the restrictions on the use of names in the scope of nested classes. Only when declaring an unnamed bit-field may the value of the constant-expression be equal to zero. Anonymous unions declared in a named namespace or in the global namespace shall be declared static. The result of the conversion is determined according to the following rules: See also [basic.lval]. asm-definitions are described in [dcl.asm], and linkage-specifications are described in [dcl.link]. What constitutes an access to an object that has volatile-qualified type is implementation-defined. A scoped enumeration shall not be later redeclared as unscoped or with a different underlying type. Two using-declarations may introduce functions with the same name and the same parameter-type-list. The specifiers indicate the type, storage class or other properties of the entities being declared. There shall be no references to references, no arrays of references, and no pointers to references. Relations between operators, such as ++a meaning a+=1, are not guaranteed for overloaded operators. A value of integral or enumeration type can be explicitly converted to a complete enumeration type. The delete-expression operator destroys a most derived object or array created by a new-expression. The destination type of a cast using the cast notation can be ``pointer to incomplete class type''. The characters // start a comment, which terminates immediately before the next new-line character. If a token matches both user-defined-literal and another literal kind, it is treated as the latter. Paragraphs labeled ``Note(s):'' or ``Example(s):'' are informative, other paragraphs are normative. Examples from [iterator.requirements] include: InputIterator, ForwardIterator, Function, Predicate. Names that are defined as functions in C shall be defined as functions in the C++ standard library. Each get member parses a format as produced by a corresponding format specifier to time_put<>::put. An implicitly-declared special member function is declared at the closing } of the class-specifier. A temporary expression bound to a reference member from a default member initializer is ill-formed. The class template owner_less allows ownership-based mixed comparisons of shared and weak pointers. The effect of access control on the order of allocation of data members is described in [class.mem]. operator case) cannot be implicitly converted to a pointer to the naming class of the right operand. a name from an outer scope remains visible up to the point of declaration of the name that hides it. A program shall contain a global function called main, which is the designated start of the program. A pointer value becomes invalid when the storage it denotes reaches the end of its storage duration. The library provides four basic kinds of sequence containers: vector, forward_list, list, and deque. Except where otherwise specified, the meaning of an attribute-declaration is implementation-defined. The inline specifier can be applied only to the declaration or definition of a variable or function. The type-specifier-seq of an enum-base shall name an integral type; any cv-qualification is ignored. If a predefined variable is not odr-used, its string value need not be present in the program image. A pure virtual function need be defined only if called with, or as if with, the qualified-id syntax. A goto or switch statement shall not be used to transfer control into a try block or into a handler. An entity captured by a lambda-expression is odr-used in the scope containing the lambda-expression. If two operands compare equal, the result is true for the == operator and false for the != operator. Conditional expressions group right-to-left. The first expression is contextually converted to bool. The header has the following addition: namespace std bool uncaught_exception() noexcept; The library described in Clause 7 of ISO/IEC 9899:2011 is hereinafter called the C standard library. The ECMAScript Language Specification described in Standard Ecma-262 is hereinafter called ECMA-262. Two kinds of implementations are defined: a hosted implementation and a freestanding implementation. If the file pointed to does not exist, the symbolic link is said to be a ``dangling'' symbolic link. Generic format observer functions return strings formatted according to the generic pathname format. The Boolean literals are the keywords false and true. Such literals are prvalues and have type bool. The names and global function signatures described in [contents] are reserved to the implementation. A C++ program may define facets to be added to a locale and used identically as the built-in facets. Not all function declarations can be overloaded. Those that cannot be overloaded are specified here. In copy-list-initialization, if an explicit constructor is chosen, the initialization is ill-formed. An overloaded function name shall not be used without arguments in contexts other than those listed. The following operators cannot be overloaded: . .* :: ?: nor can the preprocessing symbols # and ##. A destructor is trivial if it is not user-provided and if: Otherwise, the destructor is non-trivial. Any deallocation function for a class X is a static member (even if not explicitly declared static). The implicitly-defined copy assignment operator for a union X copies the object representation of X. If no case matches and if there is no default then none of the statements in the switch is executed. Use of the offsetof macro with a type other than a standard-layout class is conditionally-supported. The result of applying the offsetof macro to a static data member or a function member is undefined. A pair of pointers or a pointer plus a length would be obvious representations for initializer_list. A function template can be overloaded with other function templates and with non-template functions. Deduction guides are used when a template-name appears as a type specifier for a deduced class type. The library may reuse the value of a thread::id of a terminated thread that can no longer be joined. The library provides basic function object classes for all of the logical operators in the language. The library provides basic function object classes for all of the bitwise operators in the language. The function object pred shall not apply any non-constant function through the dereferenced iterator. Implementations should make atomic stores visible to atomic loads within a reasonable amount of time. An object of type cv void* shall have the same representation and alignment requirements as cv char*. The iterator returned from a.emplace(p, args) points to the new element constructed from args into a. The static specifier can be applied only to names of variables and functions and to anonymous unions. A static specifier can be used in declarations of class members; [class.static] describes its effect. The constexpr specifier has no effect on the type of a constexpr function or a constexpr constructor. A static local variable in an inline function with external linkage always refers to the same object. Each init-declarator in a declaration is analyzed separately as if it was in a declaration by itself. The order in which the base class subobjects are allocated in the most derived object is unspecified. A base class specifier that does not contain the keyword virtual, specifies a non-virtual base class. The new-expression attempts to create an object of the type-id or new-type-id to which it is applied. A C++ program can provide alternative definitions of these functions, and/or class-specific versions. A binary integer literal (base two) begins with 0b or 0B and consists of a sequence of binary digits. Using an escape sequence for a question mark is supported for compatibility with ISO C++14 and ISO C. It is unspecified whether any non-member functions in the C++ standard library are defined as inline. A conditionally-supported-directive is conditionally-supported with implementation-defined semantics. The type of the conversion function is ``function taking no parameter returning conversion-type-id''. Variables with automatic storage duration declared in the block are destroyed on exit from the block. A member template can be defined within or outside its class definition or class template definition. A dependent base class is a base class that is a dependent type and is not the current instantiation. The resolution of timing provided by an implementation depends on both operating system and hardware. A specialization of class template pmr::polymorphic_allocator conforms to the Allocator requirements. An expression is potentially evaluated unless it is an unevaluated operand or a subexpression thereof. The rules for declarations and expressions describe in which contexts incomplete types are prohibited. A pointer to void does not have a pointer-to-object type, however, because void is not an object type. A new-extended alignment is represented by an alignment greater than __STDCPP_DEFAULT_NEW_ALIGNMENT__. The address-of operator & shall not be applied to a bit-field, so there are no pointers to bit-fields. For associative containers with unique keys the stronger condition holds, value_comp(*i, *j) != false. The standard header contains a mechanism for accessing arguments passed using the ellipsis . If a function is overloaded, it is referenced only if the function is selected by overload resolution. The syntax provides for empty initializer-lists, but nonetheless C++ does not have zero length arrays. An lvalue of a derived class type can be bound to a reference to an accessible unambiguous base class. Two base class subobjects share the non-static member subobjects of their common virtual base classes. error_condition values are portable abstractions, while error_code values are implementation specific. If a destructor directly invoked by stack unwinding exits with an exception, std::terminate is called. The value computation of the ++ expression is sequenced before the modification of the operand object. [class.cdtor] describes the behavior of typeid applied to an object under construction or destruction. The result of the expression static_cast(v) is the result of converting the expression v to type T. If two operands p and q compare equal, p<=q and p>=q both yield true and pq both yield false. Each object of class strstreambuf has a seekable area, delimited by the pointers seeklow and seekhigh. Translation units can be separately translated and then later linked to produce an executable program. The value of a char32_t literal containing a single c-char is equal to its ISO 10646 code point value. If a UTF-8 string literal token is adjacent to a wide string literal token, the program is ill-formed. The C++ standard library provides 61 C++ library headers, as shown in Table [tab:cpp.library.headers]. A specialization of a member function template does not override a virtual function from a base class. A template explicit specialization is in the scope of the namespace in which the template was defined. The calling agent is determined by context, e.g. the calling thread that contains the call, and so on. this access also applies to implicit references to constructors, conversion functions, and destructors. The semantics of the operations on specializations of atomic are defined in [atomics.types.operations]. The atomic_flag type provides the classic test-and-set functionality. It has two states, set and clear. The point of declaration for a template parameter is immediately after its complete template-parameter. If an associated namespace is an inline namespace, its enclosing namespace is also included in the set. The non-allocating forms described in [new.delete.placement] do not perform allocation or deallocation. Pointers to incomplete types are allowed although there are restrictions on what can be done with them. For purposes of access checking, the injected-class-name is treated as if it were a public member name. If X is a union, a non-static data member of X that is not an anonymous union is a variant member of X. Args denotes a template parameter pack; args denotes a function parameter pack with the pattern Args&&. The set and map classes support unique keys; the multiset and multimap classes support equivalent keys. An enumeration declared by an opaque-enum-declaration has fixed underlying type and is a complete type. Since destructors do not have names, a using-declaration cannot refer to a destructor for a base class. A using-directive shall not appear in class scope, but may appear in namespace scope or in block scope. Except where explicitly noted, they are semantically equivalent and commonly referred to as references. An empty initializer list {} shall not be used as the initializer-clause for an array of unknown bound. If a lambda-expression does not include a lambda-declarator, it is as if the lambda-declarator were (). An entity is captured by reference if it is implicitly or explicitly captured but not captured by copy. The initialization and destruction of each parameter occurs within the context of the calling function. The lvalue-to-rvalue, array-to-pointer, and function-to-pointer conversions are applied to the operand. If the value 0 is added to or subtracted from a null pointer value, the result is a null pointer value. raw_storage_iterator is provided to enable algorithms to store their results into uninitialized memory. Certain features of C++ exist solely for compatibility purposes; Annex [depr] describes those features. Implementations are not required to provide behavior that is not supported by a particular file system. Since signed char and unsigned char have no implied encoding, they are not included as permitted types. If a and b are both dereferenceable, then a == b if and only if *a and *b are bound to the same object. A preprocessing token is the minimal lexical element of the language in translation phases 3 through 6. The characters /* start a comment, which terminates with the characters */. These comments do not nest. T() shall be a well-defined expression if one of those signatures is called using the default argument. An assignment operator shall be implemented by a non-static member function with exactly one parameter. The implicitly-declared move assignment operator for a class X will have the form X& X::operator=(X&&); In a function template declaration, the last component of the declarator-id shall not be a template-id. A template-parameter of a template template-parameter is permitted to have a default template-argument. A specialization for a class template has at most one point of instantiation within a translation unit. Each class template specialization instantiated from a template has its own copy of any static members. Template parameters do not participate in template argument deduction if they are explicitly specified. When a function template specialization is referenced, all of the template arguments shall have values. A unique pointer is an object that owns another object and manages that other object through a pointer. The library provides basic function object classes for all of the arithmetic operators in the language. The library provides basic function object classes for all of the comparison operators in the language. The rules for declarations and expressions describe in which contexts complete class types are required. The outermost declarative region of a translation unit is also a namespace, called the global namespace. Pointers to layout-compatible types shall have the same value representation and alignment requirements. The assignment operator sets the bit when the argument is (convertible to) true and clears it otherwise. An enumeration is a distinct type with named constants. Its name becomes an enum-name, within its scope. Forming a function pointer type is ill-formed if the function type has cv-qualifiers or a ref-qualifier. All declarations for a function shall agree exactly in both the return type and the parameter-type-list. A typedef of function type may be used to declare a function but shall not be used to define a function. The function std::uncaught_exceptions() returns the number of uncaught exceptions in the current thread. A parenthesized expression (E) is a primary expression whose type and value are identical to those of E. Many erroneous program constructs do not engender undefined behavior; they are required to be diagnosed. C++ provides a variety of fundamental types and several ways of composing new types from existing types. An instance of each object with automatic storage duration is associated with each entry into its block. The contents and meaning of the header are the same as the C standard library header . Examples from [utility.requirements] include: EqualityComparable, LessThanComparable, CopyConstructible. Several types defined in Clauses [language.support] through [thread] and Annex [depr] are bitmask types. The class collate provides features for use in the collation (comparison) and hashing of strings. A #include directive shall identify a header or source file that can be processed by the implementation. An attempt to initialize more than one non-static data member of a union renders the program ill-formed. namespace std enum float_denorm_style denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 ; If an operand of an operator is a type-dependent expression, the operator also denotes a dependent name. If initialization of an object of a mutex type fails, an exception of type system_error shall be thrown. The class recursive_mutex shall satisfy all the Mutex requirements. It shall be a standard-layout class. A lock_guard object maintains ownership of lockable objects throughout the lock_guard object's lifetime. The enum type launch is a bitmask type with launch::async and launch::deferred denoting individual bits. Member functions of future do not synchronize with themselves or with member functions of shared_future. The index_sequence alias template is provided for the common case of an integer sequence of type size_t. There are only a few kinds of operations on atomic types, though there are many instances on those kinds. There are no constraints on the contents of the allocated storage on return from the allocation function. An address that satisfies an alignment requirement also satisfies any weaker valid alignment requirement. A class-name is inserted into the scope in which it is declared immediately after the class-name is seen. The container's object of type Hash --- denoted by hash --- is called the hash function of the container. If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition. The optional attribute-specifier-seq following a declarator-id appertains to the entity that is declared. The type denoted by a decltype-specifier in a nested-name-specifier shall be a class or enumeration type. The forwarding call wrapper g returned by a call to bind(f, bound_args...) shall have a weak result type. For undated references, the latest edition of the referenced document (including any amendments) applies. A function is not an object, regardless of whether or not it occupies storage in the way that objects do. Destruction of an iterator may invalidate pointers and references previously obtained from that iterator. Preprocessing number tokens lexically include all integer literal tokens and all floating literal tokens. An octal integer literal (base eight) begins with the digit 0 and consists of a sequence of octal digits. A character literal that begins with the letter u, such as u'x', is a character literal of type char16_t. A character literal that begins with the letter U, such as U'y', is a character literal of type char32_t. An object type, a function type that does not have cv-qualifiers or a ref-qualifier, or a reference type. [nullablepointer.requirements] describes the requirements on pointer-like types that support null values. Literal suffix identifiers that do not start with an underscore are reserved for future standardization. It is possible to transfer into a block, but not in a way that bypasses declarations with initialization. The name of a template-argument shall be accessible at the point where it is used as a template-argument. A template can be declared within a class or class template; such a template is called a member template. An appearance of the name of a parameter pack is only expanded by the innermost enclosing pack expansion. A member function instantiated from a member function template is called an instantiated member function. A thread shall call unlock() once for each level of ownership acquired by calls to lock() and try_lock(). The weak_ptr class template stores a weak reference to an object that is already managed by a shared_ptr. It should be noted that it is access to members and base classes that is controlled, not their visibility. The intent is that the memory model of C++ is compatible with that of ISO/IEC 9899 Programming Language C. For narrow character types, all bits of the object representation participate in the value representation. Once the static data member has been defined, it exists even if no objects of its class have been created. For any two keys k1 and k2 in the same container, calling comp(k1, k2) shall always return the same value. For any two keys k1 and k2 in the same container, calling pred(k1, k2) shall always return the same value. The virtual specifier shall be used only in the initial declaration of a non-static class member function. An inline function or variable with external linkage shall have the same address in all translation units. [basic.lookup.elab] describes how name lookup proceeds for the identifier in an elaborated-type-specifier. During overload resolution, all functions from the transitive search are considered for argument matching. Implementations are encouraged to issue a warning if a fallthrough statement is not dynamically reachable. A single name can be used for several different functions in a single scope; this is function overloading. Typedefs and trailing-return-types are sometimes convenient when the return type of a function is complex. The class invalid_argument defines the type of objects thrown as exceptions to report an invalid argument. A lambda-expression appearing in a default argument shall not implicitly or explicitly capture any entity. When a function is called, the parameters that have object type shall have completely-defined object type. Lvalue-to-rvalue, array-to-pointer, and function-to-pointer conversions are not applied to the expression. An object that is not an array element is considered to belong to a single-element array for this purpose. A C++ translation unit obtains access to these names by including the appropriate standard library header. Two or more threads of execution can access separate memory locations without interfering with each other. in some contexts, such as unevaluated operands, a syntactic subexpression is considered a full-expression. The process of obtaining a normalized path from a path that is not in normal form is called normalization. Describes a sequence of values of a given encoded character type terminated by that type's null character. The Requirements subclauses may describe names that are used to specify constraints on template arguments. codecvt converts between the native character sets for narrow and wide characters. The contents and meaning of the header are the same as the C standard library header . If the constructor was inherited from multiple base class subobjects of type B, the program is ill-formed. The contents and meaning of the header are the same as the C standard library header . A local class, a local variable, or a friend function defined in a templated entity is a templated entity. A template-parameter shall not be given default arguments by two different declarations in the same scope. All of the parameter packs expanded by a pack expansion shall have the same number of arguments specified. An explicit instantiation declaration shall not name a specialization of a template with internal linkage. Implementation-provided clocks that are used for these functions shall meet the TrivialClock requirements. The implementation shall provide the template future and two specializations, future and future. Objects of type bad_variant_access are thrown to report invalid accesses to the value of a variant object. It is the caller's responsibility to ensure that the invocation does not introduce data races or deadlocks. A compound type is not cv-qualified by the cv-qualifiers (if any) of the types from which it is compounded. Whenever a prvalue appears in a context where a glvalue is expected, the prvalue is converted to an xvalue. An enclosing function has no special access to members of the local class; it obeys the usual access rules. It is implementation-defined whether objects of char type are represented as signed or unsigned quantities. Every using-declaration is a declaration and a member-declaration and so can be used in a class definition. Initial values can also be specified in a declarator; initializers are discussed in [dcl.init, class.init]. A function with a deleted definition shall not override a function that does not have a deleted definition. A goto, break, return, or continue statement can be used to transfer control out of a try block or handler. A ( token that follows noexcept is part of the noexcept-specification and does not commence an initializer. Using an overloaded operator causes a function call; the above covers only operators with built-in meaning. An expression of the form (e1 op1 ... op2 e2) where op1 and op2 are fold-operators is called a binary fold. The result of the expression reinterpret_cast(v) is the result of converting the expression v to type T. More stringent correspondences between abstract and actual semantics may be defined by each implementation. ``Carries a dependency to'' is a subset of ``is sequenced before'', and is similarly strictly intra-thread. The class sentry defines a class that is responsible for doing exception safe prefix and suffix operations. Some behavior is specified by reference to POSIX. How such behavior is actually implemented is unspecified. A name prefixed by the keyword template shall be a template-id or the name shall refer to a class template. When template argument packs or default template-arguments are used, a template-argument list can be empty. For the purpose of instantiation, the substatements of a constexpr if statement are considered definitions. Each function template specialization instantiated from a template has its own copy of any static variable. The class template pointer_traits supplies a uniform interface to certain attributes of pointer-like types. A function object type is an object type that can be the type of the postfix-expression in a function call. The function class template provides polymorphic wrappers that generalize the notion of a function pointer. For any given type T, exactly one of the primary type categories has a value member that evaluates to true. A member of a private base class might be inaccessible as an inherited member name, but accessible directly. Except for pointers to static members, text referring to ``pointers'' does not apply to pointers to members. The constant-expression shall be an integral constant expression with a value greater than or equal to zero. The sequence containers offer the programmer different complexity trade-offs and should be used accordingly. For multiset and multimap, insert, emplace, and erase preserve the relative ordering of equivalent elements. An explicit specialization can differ from the template declaration with respect to the constexpr specifier. Two function types with different language linkages are distinct types even if they are otherwise identical. An overriding function in a derived class does not acquire default arguments from the function it overrides. Aggregate initialization does not allow accessing protected and private base class' members or constructors. The operand of a cast using the cast notation can be a prvalue of type ``pointer to incomplete class type''. Most of the library's algorithmic templates that operate on data structures have interfaces that use ranges. Insert iterators satisfy the requirements of output iterators. operator* returns the insert iterator itself. a sequence of values that have character type that precede the terminating null character type value charT() Where no distinction is explicitly made in the description, the behavior described is the required behavior. When operator-> returns, the operator -> is applied to the value returned, with the original second operand. For every promoted integral type T, there exist candidate operator functions of the form @T@ operator~(@T@); A conditionally-supported-directive shall not begin with any of the directive names appearing in the syntax. In the decl-specifier-seq of a condition, each decl-specifier shall be either a type-specifier or constexpr. Variables with automatic storage duration are initialized each time their declaration-statement is executed. The member eof() shall return an implementation-defined constant that cannot appear as a Unicode code point. Calls to the function getenv shall not introduce a data race provided that nothing modifies the environment. A call to the function signal synchronizes with any resulting invocation of the signal handler so installed. Template arguments can be deduced from the type specified when taking the address of an overloaded function. F is more specialized than G if F is at least as specialized as G and G is not at least as specialized as F. A template-argument can be deduced from a function, pointer to function, or pointer to member function type. The class timed_mutex shall satisfy all of the TimedMutex requirements. It shall be a standard-layout class. There is a generic class template atomic. The type of the template argument T shall be trivially copyable. The class-name is also inserted into the scope of the class itself; this is known as the injected-class-name. A standard-layout struct is a standard-layout class defined with the class-key struct or the class-key class. There shall not be a static and a non-static member function with the same name and the same parameter types. Member functions of a local class shall be defined within their class definition, if they are defined at all. iterator and const_iterator types for sequence containers shall be at least of the forward iterator category. An array is an aggregate that can be list-initialized with up to N elements whose types are convertible to T. The first template parameter T of the container adaptors shall denote the same type as Container::value_type. The conversions allowed as floating point promotions are excluded from the set of floating point conversions. Forming a reference to function type is ill-formed if the function type has cv-qualifiers or a ref-qualifier. error_category objects are passed by reference, and two such objects are equal if they have the same address. Clause [expr] defines the effects of operators when applied to types for which they have not been overloaded. The type of the expression is the type of the identifier. The result is the entity denoted by the identifier. In the decl-specifier-seq of the lambda-declarator, each decl-specifier shall either be mutable or constexpr. An id-expression that is not an odr-use refers to the original entity, never to a member of the closure type. it is not possible to use a pointer to member that refers to a mutable member to modify a const class object. Negators not1 and not2 take a unary and a binary predicate, respectively, and return their logical negations. The iterator template may be used as a base class to ease the definition of required types for new iterators. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit. Directory iteration shall not yield directory entries for the current (dot) and parent (dot-dot) directories. A specialization ctype is provided so that the member functions on type char can be implemented inline. Switch statements can be nested; a case or default label is associated with the smallest switch enclosing it. If a deduced parameter type is not permitted for a template-parameter declaration, the program is ill-formed. A specialization is a class, function, or class member that is either instantiated or explicitly specialized. An implicit instantiation is never generated for an explicit specialization that is declared but not defined. A Lock type shall meet the BasicLockable requirements. All of the standard mutex types meet this requirement. The implementation shall provide the template promise and two specializations, promise and promise. The representation of an atomic specialization need not have the same size as its corresponding argument type. Given a set of declarations in a single declarative region, each of which specifies the same unqualified name, A program that defines main as deleted or that declares main to be inline, static, or constexpr is ill-formed. Block-scope variables not explicitly declared static, thread_local, or extern have automatic storage duration. There is a partial ordering on cv-qualifiers, so that a type can be said to be more cv-qualified than another. The result of the alignof operator reflects the alignment requirement of the type in the complete-object case. A pure-specifier shall be used only in the declaration of a virtual function that is not a friend declaration. Each implementation should choose a distinctive name for the attribute-namespace in an attribute-scoped-token. A program that refers to a deleted function implicitly or explicitly, other than to declare it, is ill-formed. The order of initialization of variables with static storage duration is described in [basic.start, stmt.dcl]. A pointer to a derived class can be implicitly converted to a pointer to an accessible unambiguous base class. Names referenced in the lambda-declarator are looked up in the context in which the lambda-expression appears. [class.cdtor] describes the behavior of a dynamic_cast applied to an object under construction or destruction. this prevents ambiguities between the declarator operators &, &&, *, and [] and their expression counterparts. The class basic_filebuf associates both the input sequence and the output sequence with a file. value_type is a typedef for the operating system dependent encoded character type used to represent pathnames. Calling a library function with more than a single constant for an option group results in undefined behavior. The behavior of a recursive_directory_iterator is the same as a directory_iterator unless otherwise specified. Previously translated translation units and instantiation units can be preserved individually or in libraries. The identifiers in Table [tab:identifiers.special] have a special meaning when appearing in a certain context. Many of the objects manipulated by function signatures declared in are character sequences or ntbss. Every destructor in the C++ standard library shall behave as if it had a non-throwing exception specification. The number of digits required after the decimal point (if any) is exactly the value returned by frac_digits(). Literal operators and literal operator templates are usually invoked implicitly through user-defined literals. Default member initializers of non-static data members are ignored. See also the example in [class.base.init]. Virtual base class subobjects shall be initialized only once by the implicitly-defined copy/move constructor . A return statement with an operand of type void shall be used only in a function whose return type is cv void. The function templates defined in [utility.swap, iterator.range] are available when is included. A parameter pack whose name appears within the pattern of a pack expansion is expanded by that pack expansion. The members of the class template partial specialization are unrelated to the members of the primary template. The primary type categories correspond to the descriptions given in section [basic.types] of the C++ standard. [class.base.init, class.cdtor] describe the behavior of objects during the construction and destruction phases. The signed and unsigned integer types shall satisfy the constraints given in the C standard, section 5.2.4.2.1. An array object and its first element are not pointer-interconvertible, even though they have the same address. The temporary materialization conversion is applied. The result is a pointer to the first element of the array. An enumerator-definition with = gives the associated enumerator the value indicated by the constant-expression. The optional attribute-specifier-seq in the unnamed-namespace-definition appertains to [TeXComm "uniquens" []]. The default language linkage of all function types, function names, and variable names is C++ language linkage. A base class subobject might have a layout different from the layout of a most derived object of the same type. With respect to an indeterminately-sequenced function call, the operation of postfix ++ is a single evaluation. A failed cast to reference type throws an exception of a type that would match a handler of type std::bad_cast. The sizeof operator can be applied to a pointer to a function, but shall not be applied directly to a function. back_inserter, front_inserter, and inserter are three functions making the insert iterators out of a container. A source-file new-line in a raw string literal results in a new-line in the resulting execution string literal. Within char32_t and char16_t literals, any universal-character-names shall be within the range 0x0 to 0x10FFFF. The descriptions of many library functions rely on the C standard library for the semantics of those functions. The names defined as macros in C include the following: assert, offsetof, setjmp, va_arg, va_end, and va_start. Then the operator is treated as the corresponding built-in operator and interpreted according to Clause [expr]. An alternative token is not an identifier, even when its spelling consists entirely of letters and underscores. The names, encoding rule, and collating sequence for types are all unspecified and may differ between programs. The definition of an explicitly specialized class is unrelated to the definition of a generated specialization. An execution agent is an entity such as a thread that may perform work in parallel with other execution agents. A clock is a bundle consisting of a duration, a time_point, and a function now() to get the current time_point. Clock shall meet the Clock requirements. If Duration is not an instance of duration, the program is ill-formed. The functions asctime, ctime, gmtime, and localtime are not required to avoid data races. See also: ISO C~7.27. [class.mfct, class.static] further describe the restrictions on the use of names in member function definitions. For a pseudo-destructor call, the unqualified-id is looked up in the context of the complete postfix-expression. Some implementations might define that copying an invalid pointer value causes a system-generated runtime fault. Plain char, signed char, and unsigned char are three distinct types, collectively called narrow character types. Member functions of a local class shall be defined inline in their class definition, if they are defined at all. It is unspecified whether an iterator with value a.end() before the swap will have value b.end() after the swap. erase(k) does not throw an exception unless that exception is thrown by the container's Compare object (if any). For unordered_multiset and unordered_multimap, rehashing preserves the relative ordering of equivalent elements. If thread_local appears in any declaration of a variable it shall be present in all declarations of that entity. In an initializer of the form ( @expression-list@ ) the expression-list shall be a single assignment-expression. The identifiers in an enumerator-list are declared as constants, and can appear wherever constants are required. The attribute-token fallthrough may be applied to a null statement; such a statement is a fallthrough statement. In member function declarations, names in default arguments are looked up as described in [basic.lookup.unqual]. A declaration of a block-scope variable with external or internal linkage that has an initializer is ill-formed. A function-try-block associates a handler-seq with the ctor-initializer, if present, and the compound-statement. C++ program constructed according to the syntax rules, diagnosable semantic rules, and the one-definition rule . A C++ program can check if a locale implements a particular facet with the function template has_facet(). Each locale member function which takes a locale::category argument operates on the corresponding set of facets. time_get is used to parse a character sequence, extracting components of a time or date into a struct tm record. A given name can refer to one or more function templates and also to a set of overloaded non-template functions. In qualified function calls, the name to be resolved is an id-expression and is preceded by an -> or . operator. The member eof() shall return an implementation-defined constant that cannot appear as a valid UTF-16 code unit. Note that va_start is required to work as specified even if unary operator& is overloaded for the type of parmN. A member class of a class template may be defined outside the class template definition in which it is declared. a base class can be the current instantiation in the case of a nested class naming an enclosing class as a base. A class, function, variable, or member template specialization can be explicitly instantiated from its template. Template argument deduction involving parameter packs can deduce zero or more arguments for each parameter pack. An execution agent may use a lock to aid in managing ownership of a lockable object in an exception safe manner. An instantiation of tuple with two arguments is similar to an instantiation of pair with the same two arguments. There shall be atomic typedefs corresponding to non-atomic typedefs as specified in Table [tab:atomics.typedefs]. Operations on an object of type atomic_flag shall be lock-free. Hence the operations should also be address-free. The point of declaration of an alias or alias template immediately follows the type-id to which the alias refers. An inline static data member may be defined in the class definition and may specify a brace-or-equal-initializer. A sequence container organizes a finite set of objects, all of the same type, into a strictly linear arrangement. a function type that has a cv-qualifier-seq is not a cv-qualified type; there are no cv-qualified function types. For non-template functions, default arguments can be added in later declarations of a function in the same scope. The class overflow_error defines the type of objects thrown as exceptions to report an arithmetic overflow error. The optional attribute-specifier-seq in an exception-declaration appertains to the parameter of the catch clause. If a return statement appears in a handler of the function-try-block of a constructor, the program is ill-formed. The left-hand side of the arrow operator shall be of pointer to scalar type. This scalar type is the object type. The result of the unary & operator is a pointer to its operand. The operand shall be an lvalue or a qualified-id. If the new-placement syntax is used, the initializer-clauses in its expression-list are the succeeding arguments. If no exception is presently being handled, evaluating a throw-expression with no operand calls std::terminate(). [definitions] defines additional terms that are used only in Clauses [library] through [thread] and Annex [depr]. The types streampos and wstreampos are used for positioning streams specialized on char and wchar_t respectively. Quoted manipulators provide string insertion and extraction of quoted strings (for example, XML and CSV formats). A path that unambiguously identifies the location of a file without reference to an additional starting location. The values of the members of the execution character sets and the sets of additional members are locale-specific. Identifiers that are keywords or operators in C++ shall not be defined as macros in C++ standard library headers. At most one user-defined conversion (constructor or conversion function) is implicitly applied to a single value. A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type. Any expression in a mem-initializer is evaluated as part of the full-expression that performs the initialization. Disambiguation precedes parsing, and a statement disambiguated as a declaration may be an ill-formed declaration. The defined types for int_type, pos_type, and state_type shall be wint_t, wstreampos, and mbstate_t respectively. Member functions of shared_future do not synchronize with themselves, but they synchronize with the shared state. The memory_resource class is an abstract interface to an unbounded set of classes encapsulating memory resources. A name can be hidden by an explicit declaration of that same name in a nested declarative region or derived class. The declaration of a member in a derived class hides the declaration of a member of a base class of the same name. A class is considered a completely-defined object type (or complete type) at the closing } of the class-specifier. The container's object of type Pred --- denoted by pred --- is called the key equality predicate of the container. Each decl-specifier shall appear at most once in a complete decl-specifier-seq, except that long may appear twice. Each enum-name and each unscoped enumerator is declared in the scope that immediately contains the enum-specifier. Members declared by a using-declaration can be referred to by explicit qualification just like other member names. A default argument is evaluated each time the function is called with no argument for the corresponding parameter. Given such an expression T(x1, x2, ...), construct the declaration T t(x1, x2, ...); for some invented variable t. Any expression can be explicitly converted to type cv void, in which case it becomes a discarded-value expression. The address of the created object will not necessarily be the same as that of the block if the object is an array. In simple assignment (=), the value of the expression replaces that of the object referred to by the left operand. The implementation shall ensure that no program execution demonstrates a cycle in the ``happens before'' relation. In a hexadecimal floating literal, the exponent indicates the power of 2 by which the significand is to be scaled. The terminating d-char-sequence of a raw-string is the same sequence of characters as the initial d-char-sequence. [structure] describes the structure of the normative Clauses [language.support] through [thread] and Annex [depr]. The value of an ntbs is the sequence of values of the elements up to and including the terminating null character. Implementations may (but are not required to) delegate extraction of smaller types to extractors for larger types. A destructor is potentially invoked if it is invoked or as specified in [expr.new, class.base.init, except.throw]. If a deallocation function has no explicit exception-specification, it has a non-throwing exception specification. If a constructor delegates to itself directly or indirectly, the program is ill-formed; no diagnostic is required. If the init-statement is a declaration, the scope of the name(s) declared extends to the end of the for statement. The headers , , and supply characteristics of implementation-dependent arithmetic types. The header defines several types and functions related to the handling of exceptions in a C++ program. If the qualified-id in a typename-specifier does not denote a type or a class template, the program is ill-formed. The lookup of names dependent on the template parameters is postponed until the actual template argument is known. When a function parameter pack appears in a non-deduced context, the type of that parameter pack is never deduced. The same restrictions apply to the parameter-declaration-clause of a deduction guide as in a function declaration. The class template bitsetdescribes an object that can store a sequence consisting of a fixed number of bits, N. It is implementation-defined whether a program in a freestanding environment is required to define a main function. Declarations in a local class shall not odr-use a variable with automatic storage duration from an enclosing scope. Since the result has type ``pointer to member of D of type cv T'', indirection through it with a D object is valid. A definition causes the appropriate amount of storage to be reserved and any appropriate initialization to be done. Members of an inline namespace can be used in most respects as though they were members of the enclosing namespace. A virtual function is specified pure by using a pure-specifier in the function declaration in the class definition. The class underflow_error defines the type of objects thrown as exceptions to report an arithmetic underflow error. The exception-declaration shall not denote an incomplete type, an abstract class type, or an rvalue reference type. The program is also ill-formed if the naming class is an ambiguous base of the class type of the object expression. basic_iostream is a class template derived from both basic_istream and basic_ostream. In C++, upper- and lower-case letters are considered different for all identifiers, including external identifiers. A decimal integer literal (base ten) begins with a digit other than 0 and consists of a sequence of decimal digits. The has-include-expression evaluates to 1 if the search for the source file succeeds, and to 0 if the search fails. Although nullptr's address cannot be taken, the address of another nullptr_t object that is an lvalue can be taken. If an explicit specialization or partial specialization of initializer_list is declared, the program is ill-formed. The implementation shall behave as if no library function other than locale::global() calls the setlocale function. The substitution proceeds in lexical order and stops when a condition that causes deduction to fail is encountered. In the case of overloaded function names, access control is applied to the function selected by overload resolution. An object type is a (possibly cv-qualified) type that is not a function type, not a reference type, and not cv void. An array type whose elements are cv-qualified is also considered to have the same cv-qualifications as its elements. The name of a nested class is local to its enclosing class. The nested class is in the scope of its enclosing class. A union can have member functions (including constructors and destructors), but it shall not have virtual functions. An object declaration, however, is also a definition unless it contains the extern specifier and has no initializer. A function or static data member declared with the constexpr specifier is implicitly an inline function or variable. If an opaque-enum-declaration contains a nested-name-specifier, the declaration shall be an explicit specialization. A function is user-provided if it is user-declared and not explicitly defaulted or deleted on its first declaration. A type denoted in a dynamic-exception-specification shall not denote an incomplete type or an rvalue reference type. If an expression initially has the type ``reference to T'', the type is adjusted to T prior to any further analysis. A program is ill-formed if it uses static_cast to perform the inverse of an ill-formed standard conversion sequence. For two similar types T1 and T2, a prvalue of type T1 may be explicitly converted to the type T2 using a const_cast. ostream_iterator writes (using operator<<) successive elements onto the output stream from which it was constructed. operator-> may return a proxy. Each time operator++ is evaluated, the iterator advances to the next input character. The atomic operations library allows more fine-grained concurrent access to shared data than is possible with locks. An rvalue or lvalue t is swappable if and only if t is swappable with any rvalue or lvalue, respectively, of type T. A template parameter with name International represents the set of all possible specializations on a bool parameter. A function member of a derived class is not in the same scope as a function member of the same name in a base class. A declaration whose literal-operator-id uses such a literal suffix identifier is ill-formed; no diagnostic required. If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined. An explicit specialization of a member or member template is specified using the syntax for explicit specialization. A trailing template parameter pack not otherwise deduced will be deduced to an empty sequence of template arguments. Template parameters do not participate in template argument deduction if they are used only in non-deduced contexts. An execution agent owns a mutex from the time it successfully calls one of the lock functions until it calls unlock. Access control is applied uniformly to all names, whether the names are referred to from declarations or expressions. To determine the scope of a declaration, it is sometimes convenient to refer to the potential scope of a declaration. [class.static.data] further describes the restrictions on the use of names in the definition of a static data member. If an associated namespace directly contains inline namespaces, those inline namespaces are also included in the set. If control flows off the end of the compound-statement of main, the effect is equivalent to a return with operand 0 . The program has undefined behavior if: For example, before the construction of a global object of non-POD class type. thus in a const member function, the object for which the function is called is accessed through a const access path. list or forward_list should be used when there are frequent insertions and deletions from the middle of the sequence. The iterator returned from a.insert(p, n, t) points to the copy of the first element inserted into a, or p if n == 0. The iterator returned from a.insert(p, i, j) points to the copy of the first element inserted into a, or p if i == j. erase(k) does not throw an exception unless that exception is thrown by the container's Hash or Pred object (if any). A program that calls for default-initialization or value-initialization of an entity of reference type is ill-formed. The exception-declaration in a handler describes the type(s) of exceptions that can cause that handler to be entered. Clauses [language.support] through [thread] and Annex [depr] (the library clauses) describe the Standard C++ library. Some operating systems may have no unambiguous way to distinguish between native format and generic format arguments. [using.headers] describes effects during translation phase 4, while [using.linkage] describes effects during phase 8. The preprocessing tokens within a preprocessing directive are not subject to macro expansion unless otherwise stated. There shall be white-space between the identifier and the replacement list in the definition of an object-like macro. There are three contexts in which temporaries are destroyed at a different point than the end of the full-expression. case and default labels in themselves do not alter the flow of control, which continues unimpeded across such labels. The header defines all macros the same as the C standard library header . See also: ISO C 5.2.4.2.2 The header defines a class template and several support functions related to list-initialization~. A template, a template explicit specialization, and a class template partial specialization shall not have C linkage. The class shared_mutex shall satisfy all of the requirements for shared mutexes. It shall be a standard-layout class. Any instance of variant at any given time either holds a value of one of its alternative types, or it holds no value. Implementations are not permitted to use additional storage, such as dynamic memory, to allocate the contained value. Specializations of weak_ptr shall be CopyConstructible and CopyAssignable, allowing their use in standard containers. The access rules are considered only once name lookup and function overload resolution (if applicable) have succeeded. A name prefixed by the unary scope operator :: is looked up in global scope, in the translation unit where it is used. The keyword static applied to a class data member in a class definition gives the data member static storage duration. An allocation function that fails to allocate storage can invoke the currently installed new-handler function, if any. [basic.types] and the subclauses thereof impose requirements on implementations regarding the representation of types. For an object that is not within its lifetime, this is the first byte in memory that it will occupy or used to occupy. For an unordered_map the key type is Key, the mapped type is T, and the value type is std::pair. The integer conversion rank is used in the definition of the integral promotions and the usual arithmetic conversions. A type defined within the body of an inline function with external linkage is the same type in every translation unit. Placeholder type deduction is the process by which a type containing a placeholder type is replaced by a deduced type. A name or entity declared without the deprecated attribute can later be re-declared with the attribute and vice-versa. If an incomplete or empty initializer-list leaves a member of reference type uninitialized, the program is ill-formed. Even if the result of name lookup is unambiguous, use of a name found in multiple subobjects might still be ambiguous. The class domain_error defines the type of objects thrown as exceptions by the implementation to report domain errors. The value of each enum errc constant shall be the same as the value of the macro shown in the above synopsis. The exception with the most recently activated handler that is still active is called the currently handled exception. A deallocation function with no explicit exception-specification has an exception specification that is the empty set. Stream operations that return a value of type traits::pos_type return P(O(-1)) as an invalid value to signal an error. Multiple successive directory-separator characters are considered to be the same as one directory-separator character. Calling any non-const member function of a path object invalidates all iterators referring to elements of that object. The order of directory entries obtained by dereferencing successive increments of a directory_iterator is unspecified. For each basic execution character set, the values of the members shall be non-negative and distinct from one another. The characters '(' and ')' are permitted in a raw-string. Thus, R"delimiter((a|b))delimiter" is equivalent to "(a|b)". The facilities of the C standard library are provided in 26 additional headers, as shown in Table [tab:cpp.c.headers]. It is intentional that there is no C++ header for any of these C headers: , , . Library implementations should report errors by throwing exceptions of or derived from the standard exception classes. Non-member functions and static member functions match targets of function pointer type or reference to function type. A default constructor is trivial if it is not user-provided and if: Otherwise, the default constructor is non-trivial. Member functions (including virtual member functions, [class.virtual]) can be called for an object under construction. A non-type template-parameter of type ``array of T'' or of function type T is adjusted to be of type ``pointer to T''. A member function of a class template may be defined outside of the class template definition in which it is declared. Template arguments cannot be deduced from function arguments involving constructs other than the ones specified above. The class recursive_timed_mutex shall satisfy all of the TimedMutex requirements. It shall be a standard-layout class. A call wrapper type is a type that holds a callable object and supports a call operation that forwards to that object. strftime supports the C conversion specifiers C, D, e, F, g, G, h, r, R, t, T, u, V, and z, and the modifiers E and O. The injected-class-name might be less accessible than the name of the base class in the scope in which it was declared. If a base class is accessible, one can implicitly convert a pointer to a derived class to a pointer to that base class. Specializations should have the same size whenever possible, as this reduces the effort required to port existing code. The point of declaration for an injected-class-name is immediately following the opening brace of the class definition. An explicitly specialized non-inline static data member or variable template specialization has ordered initialization. The member-declarator-list can be omitted only after a class-specifier or an enum-specifier or in a friend declaration. There shall be exactly one definition of a static data member that is odr-used in a program; no diagnostic is required. In general, one must use explicit destructor calls and placement new-expression to change the active member of a union. The attribute-specifier-seq appertains to each of the entities declared by the declarators of the init-declarator-list. For an enumeration whose underlying type is fixed, the values of the enumeration are the values of the underlying type. A name or entity declared without the maybe_unused attribute can later be redeclared with the attribute and vice versa. If an initializer-clause is specified in a parameter-declaration this initializer-clause is used as a default argument. Parameters of a function declared before a default argument are in scope and can hide namespace and class member names. Unless redeclared in the derived class, members of a base class are also considered to be members of the derived class. The class range_error defines the type of objects thrown as exceptions to report range errors in internal computations. The scope and lifetime of the parameters of a function or constructor extend into the handlers of a function-try-block. [basic.lookup.classref] describes how names are looked up after the . and -> operators. Note that (*(E1)) is an lvalue. When typeid is applied to a type-id, the result refers to a std::type_info object representing the type of the type-id. Either the radix point or the letter e or E and the exponent (not both) can be omitted from a decimal floating literal. In a narrow string literal, a universal-character-name may map to more than one char element due to multibyte encoding. templates, defined in Clause [input.output], that take two template arguments The arguments are named charT and traits. The name is looked up in the context of the function call following the normal rules for name lookup in function calls. operator() shall be a non-static member function with an arbitrary number of parameters. It can have default arguments. The values of the predefined macros (except for __FILE__ and __LINE__) remain constant throughout the translation unit. Each decl-specifier of the decl-specifier-seq of a destructor declaration (if any) shall be friend, inline, or virtual. Other types are disallowed either explicitly below or implicitly by the rules governing the form of template-arguments. When a non-type non-reference template-parameter is used as an initializer for a reference, a temporary is always used. A temporary object is not an acceptable template-argument when the corresponding template-parameter has reference type. A template-declaration in which the declaration is an alias-declaration declares the identifier to be a alias template. The type produced by an alias template specialization shall not directly or indirectly make use of that specialization. The declaration may declare a qualified-id, in which case the unqualified-id of the qualified-id must be a template-id. Mutexes can be either recursive or non-recursive, and can grant simultaneous ownership to one or many execution agents. Locks are intended to ease the burden of unlocking the lockable object under both normal and exceptional circumstances. Calling in_place functions results in undefined behavior. These functions might be instantiated into every object file. To toggle a bit is to change the value zero to one, or the value one to zero. Each bit has a non-negative position pos. The class template default_delete serves as the default deleter (destruction policy) for the class template unique_ptr. The duration template uses the duration_values trait to construct special values of the durations representation (Rep). If the destruction of an object with static or thread storage duration exits via an exception, std::terminate is called. It is implementation-defined whether any extended alignments are supported and the contexts in which they are supported. The iterator returned from a.insert(p, il) points to the copy of the first element inserted into a, or p if il is empty. For set and multiset the value type is the same as the key type. For map and multimap it is equal to pair. Equality comparison is a refinement of partitioning if no two objects that compare equal fall into different partitions. When multiple simple-type-specifiers are allowed, they can be freely intermixed with other decl-specifiers in any order. A using-declaration introduces a set of declarations into the declarative region in which the using-declaration appears. An identifier can optionally be provided as a parameter name; if present in a function definition, it names a parameter. Any informal reference to the body of a function should be interpreted as a reference to the non-terminal function-body. The class system_error describes an exception object used to report error conditions that have an associated error code. For a generic lambda with no lambda-capture, the closure type has a conversion function template to pointer to function. If *this is captured by a local lambda expression, its nearest enclosing function shall be a non-static member function. In the call to use_facet(loc), the type argument chooses a facet, making available all members of the named type. When used in a loop, it is faster to cache the ctype<> facet and use it directly, or use the vector form of ctype<>::is. Templates time_get and time_put provide date and time formatting and parsing. The only member a C++ program must define is the static member id, which identifies your class interface as a new facet. Only function and function template declarations can be overloaded; variable and type declarations cannot be overloaded. After the arguments for the invocation of a function-like macro have been identified, argument substitution takes place. If a class has a base class with a virtual destructor, its destructor (whether user- or implicitly-declared) is virtual. A label may have the same name as another declaration in the same scope or a template-parameter from an enclosing scope. In the decl-specifier-seq of a for-range-declaration, each decl-specifier shall be either a type-specifier or constexpr. Note that offsetof is required to work as specified even if unary operator& is overloaded for any of the types involved. For a template-name to be explicitly qualified by the template arguments, the name must be known to refer to a template. For example: template int f(T); // #1 int f(int); // #2 int k = f(1); // uses #2 int l = f<>(1); // uses #1 Class condition_variable_any provides a general condition variable that can wait on objects of user-supplied lock types. An exception of type bad_function_call is thrown by function::operator() when the function wrapper object has no target. A name nominated by a friend declaration shall be accessible in the scope of the class containing the friend declaration. For algorithms other than those described in [alg.binary.search], comp shall induce a strict weak ordering on the values. The declarative region of the name of a template parameter is nested within the immediately-enclosing declarative region. Class and array prvalues can have cv-qualified types; other prvalues always have cv-unqualified types. See Clause [expr]. The type of the prvalue may be incomplete. As a result, storage is not allocated for the prvalue and it is not destroyed. The type deduced for T is determined as described in [dcl.type.simple], as though e had been the operand of the decltype. The value of an enumerator or an object of an unscoped enumeration type is converted to an integer by integral promotion. The name of a namespace can be used to access entities declared in that namespace; that is, the members of the namespace. In a declaration attribute-specifier-seq_opt T D where D is an unadorned identifier the type of this identifier is ``T''. The base-specifier-list specifies the type of the base class subobjects contained in an object of the derived class type. If the name of an overloaded function is unambiguously found, overload resolution also takes place before access control. An abstract class can also be used to define an interface for which derived classes provide a variety of implementations. A dynamic-exception-specification denotes an exception specification that is the set of adjusted types specified thereby. If two null pointer values are subtracted, the result compares equal to the value 0 converted to the type std::ptrdiff_t. The behavior of an expression of the form E1 op= E2 is equivalent to E1 = E1 op E2 except that E1 is evaluated only once. Unless it is a bit-field, a most derived object shall have a non-zero size and shall occupy one or more bytes of storage. The result of operator* on an end-of-stream iterator is not defined. For any other iterator value a const T& is returned. The class template ostreambuf_iterator writes successive characters onto the output stream from which it was constructed. The integer part, the optional radix point, and the optional fraction part, form the significand of the floating literal. [depr.c.headers], C standard library headers, describes the effects of using the name.h (C header) form in a C++ program. where X is the class of which the function is a member and cv is the cv-qualification on the member function declaration. The switch statement causes control to be transferred to one of several statements depending on the value of a condition. It is possible to overload function templates so that two different function template specializations have the same type. An explicit instantiation does not constitute a use of a default argument, so default argument instantiation is not done. The type property inspection traits allow important characteristics of types or of combinations of types to be inspected. If a type has padding bits, the condition does not hold; otherwise, the condition holds true for unsigned integral types. Unless otherwise specified, the semantics of ExecutionPolicy algorithm overloads are identical to their overloads without. A static member may be referred to using the class member access syntax, in which case the object expression is evaluated. Unnamed classes and classes contained directly or indirectly within unnamed classes shall not contain static data members. In a union, a non-static data member is active if its name refers to an object whose lifetime has begun and has not ended. Table [tab:containers.optional.operations] lists operations that are provided for some types of containers but not others. A standard conversion sequence will be applied to an expression if necessary to convert it to a required destination type. Table [tab:simple.type.specifiers] summarizes the valid combinations of simple-type-specifiers and the types they specify. No diagnostic is required if declarations of an entity have different alignment-specifiers in different translation units. The result of name lookup for f in C is the declaration set of S(f,C). If it is an invalid set, the program is ill-formed. By contrast, runtime errors are due to events beyond the scope of the program. They cannot be easily predicted in advance. The memory for the exception object is allocated in an unspecified way, except as noted in [basic.stc.dynamic.allocation]. A member of a closure type shall not be explicitly instantiated, explicitly specialized, or named in a friend declaration. The mapping performed by reinterpret_cast might, or might not, produce a representation different from the original value. The result of the binary - operator is the difference resulting from the subtraction of the second operand from the first. With respect to an indeterminately-sequenced function call, the operation of a compound assignment is a single evaluation. Executions of atomic functions that are either defined to be lock-free or indicated as lock-free are lock-free executions. The result of operator-> on an end-of-stream iterator is not defined. For any other iterator value a const T* is returned. The numerics library provides numeric algorithms and complex number components that extend support for numeric processing. The input/output library provides the iostream components that are the primary mechanism for C++ program input and output. A program is ill-formed if the default constructor for an object is implicitly used and the constructor is not accessible. [basic.start.term] describes the order in which block-scope objects with static and thread storage duration are destroyed. The two-argument members eq and lt shall be defined identically to the built-in operators == and < for type unsigned char. A using-declaration in a derived class cannot refer to a specialization of a conversion function template in a base class. A mutex object facilitates protection against data races and allows safe synchronization of data between execution agents. The member names of the BaseCharacteristic shall not be hidden and shall be unambiguously available in the UnaryTypeTrait. In general, each particular name is valid only within some possibly discontiguous portion of program text called its scope. The lookup for an unqualified name used as the postfix-expression of a function call is described in [basic.lookup.argdep]. Objects can be created dynamically during program execution, using new-expressions, and destroyed using delete-expressions. Scalar types, POD classes, arrays of such types and cv-qualified versions of these types are collectively called POD types. The phrase ``equivalence of keys'' means the equivalence relation imposed by the comparison and not the operator== on keys. For an unordered_multimap the key type is Key, the mapped type is T, and the value type is std::pair. The container adaptors each take a Container template parameter, and each constructor takes a Container reference argument. A zero value, null pointer value, or null member pointer value is converted to false; any other value is converted to true. In a static_assert-declaration, the constant-expression shall be a contextually converted constant expression of type bool. The optional attribute-specifier-seq in a named-namespace-definition appertains to the namespace being defined or extended. All function types, function names with external linkage, and variable names with external linkage have a language linkage. A class B is a base class of a class D if it is a direct base class of D or a direct base class of one of D's base classes. The use of the virtual specifier in the declaration of an overriding function is legal but redundant (has empty semantics). A pair of expressions separated by a comma is evaluated left-to-right; the left expression is a discarded-value expression. All modifications to a particular atomic object M occur in some particular total order, called the modification order of M. An implementation for an operating system where disambiguation is required is permitted to distinguish between the formats. An invalid iterator is an iterator that may be singular. This definition applies to pointers, since pointers are iterators. Optional separating single quotes in a digit-sequence or hexadecimal-digit-sequence are ignored when determining its value. The ".h" headers dump all their names into the global namespace, whereas the newer forms keep their names in namespace std. An implementation may derive any class in the C++ standard library from a class with a name reserved to the implementation. The symbol thousands-sep is the character returned by thousands_sep(). The space character used is the value ct.widen(' '). nested_exception has a virtual destructor to make it a polymorphic class. Its presence can be tested for with dynamic_cast. f(1) and f(1) call distinct functions even though both of the functions called have the same function type. Two states are equivalent if either they both have no value, or both have a value and the contained objects are equivalent. The member names of the BaseCharacteristic shall not be hidden and shall be unambiguously available in the BinaryTypeTrait. Each named type is either a typedef to the corresponding specialization or a base class of the corresponding specialization. The point of declaration of a using-declaration that does not name a constructor is immediately after the using-declaration. The order, contiguity, and initial value of storage allocated by successive calls to an allocation function are unspecified. Objects declared as characters (char) shall be large enough to store any member of the implementation's basic character set. There are five standard signed integer types : ``signed char'', ``short int'', ``int'', ``long int'', and ``long long int''. Except when the prvalue is the operand of a decltype-specifier, a prvalue of class or array type always has a result object. A class-specifier whose class-head omits the class-head-name defines an unnamed class. An unnamed class thus can't be final. Implementations are permitted to provide additional predefined variables with names that are reserved to the implementation. A type ``array of T'', or function type T denoted in a dynamic-exception-specification is adjusted to type ``pointer to T''. The form ~~decltype-specifier also denotes the destructor, but it shall not be used as the unqualified-id in a qualified-id. A pointer to member is only formed when an explicit & is used and its operand is a qualified-id not enclosed in parentheses. A memory location is either an object of scalar type or a maximal sequence of adjacent bit-fields all having non-zero width. In a decimal floating literal, the exponent, if present, indicates the power of 10 by which the significand is to be scaled. During concatenation, ud-suffixes are removed and ignored and the concatenation process occurs as described in [lex.string]. An implementation may also define additional non-member functions that would otherwise not be called by a valid C++ program. If the keyword this is in scope and refers to class T, or a derived class of T, then the implied object argument is (*this). An implicitly-declared copy/move constructor is not an explicit constructor; it may be called for implicit type conversions. The contents and meaning of the header are the same as the C standard library header . See also: ISO C 7.4 For partial specializations, the template argument list is explicitly written immediately following the class template name. Implicitly instantiated member templates are placed in the namespace where the enclosing class or class template is defined. Some functions (e.g., promise::set_value_at_thread_exit) delay making the shared state ready until the calling thread exits. A declaration may introduce one or more names into a translation unit or redeclare names introduced by previous declarations. A non-placement allocation or deallocation function for a class is odr-used by the definition of a constructor of that class. The names in a template-argument of a template-id are looked up in the context in which the entire postfix-expression occurs. If a typedef-name that names a cv-qualified class type is used where a class-name is required, the cv-qualifiers are ignored. The header defines the class templates map and multimap; the header defines the class templates set and multiset. An lvalue of function type T can be converted to a prvalue of type ``pointer to T''. The result is a pointer to the function. A prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member type can be converted to a prvalue of type bool. An abstract class shall not be used as a parameter type, as a function return type, or as the type of an explicit conversion. In some contexts, an expression only appears for its side effects. Such an expression is called a discarded-value expression. If the result of .* or ->* is a function, then that result can be used only as the operand for the function call operator (). Most algorithms will require additional operations to read or write values, or to provide a richer set of iterator movements. The comment characters //, /*, and */ have no special meaning within a // comment and are treated just like other characters. A universal-character-name is translated to the encoding, in the appropriate execution character set, of the character named. The C standard library headers shall include only their corresponding C++ standard library header, as described in [headers]. A locale constructed from a name string (such as "POSIX"), or from parts of two named locales, has a name; all others do not. If there is a single global locale object for the entire program, implementations are not required to avoid data races on it. The two-argument members assign, eq, and lt shall be defined identically to the built-in operators =, ==, and < respectively. The two-argument members assign, eq, and lt shall be defined identically to the built-in operators =, ==, and < respectively. The two-argument members assign, eq, and lt shall be defined identically to the built-in operators =, ==, and < respectively. If any member function or operator of basic_string throws an exception, that function or operator shall have no other effect. Non-dependent names used in a template definition are found using the usual name lookup and bound at the point they are used. For each tuple constructor, an exception is thrown only if the construction of one of the types in Types throws an exception. reference_wrapper is a CopyConstructible and CopyAssignable wrapper around a reference to an object or function of type T. The members of an enclosing class have no special access to members of a nested class; the usual access rules shall be obeyed. Implementations should ensure that no ``out-of-thin-air'' values are computed that circularly depend on their own computation. The injected-class-name of a class is also considered to be a member of that class for the purposes of name hiding and lookup. end() returns an iterator which is the past-the-end value for the container. If the container is empty, then begin() == end(); Elements may be transferred in either direction between container types in the same row of Table [tab:containers.node.compat]. Since lists allow fast insertion and erasing from the middle of a list, certain operations are provided specifically for them. Certain language constructs require conversion to a value having one of a specified set of types appropriate to the construct. A prvalue of an unscoped enumeration type whose underlying type is fixed can be converted to a prvalue of its underlying type. A parameter list consisting of a single unnamed parameter of non-dependent type void is equivalent to an empty parameter list. There is a syntactic ambiguity when an ellipsis occurs at the end of a parameter-declaration-clause without a preceding comma. Static data members and anonymous bit-fields are not considered members of the class for purposes of aggregate initialization. Even though destructors are not inherited, a destructor in a derived class overrides a base class destructor declared virtual. The class out_of_range defines the type of objects thrown as exceptions to report an argument value not in its expected range. The contents of the header are the same as the POSIX header , except that errno shall be defined as a macro. The lvalue-to-rvalue, array-to-pointer, and function-to-pointer standard conversions are not applied to the operand of sizeof. Two operands of type std::nullptr_t or one operand of type std::nullptr_t and the other a null pointer constant compare equal. reference_wrapper has a weak result type. If T is a function type, result_type shall be a synonym for the return type of T. Errors arising from within the stream library would typically be reported as error_code(io_errc::stream, iostream_category()). The Iterator requirements form the basis of the iterator concept taxonomy; every iterator satisfies the Iterator requirements. A sequence of characters resembling a universal-character-name in an r-char-sequence does not form a universal-character-name. The required behavior describes the semantics of a function definition provided by either the implementation or a C++ program. Certain classes defined in the C++ standard library are required to be derived from other classes in the C++ standard library. Objects of type stateT can contain any state that is useful to communicate to or from the specialized do_in or do_out members. When two or more different declarations are specified for a single name in the same scope, that name is said to be overloaded. The set of candidate functions can contain both member and non-member functions to be resolved against the same argument list. specifies a conversion from X to the type specified by the conversion-type-id. Such functions are called conversion functions. The implicitly-defined copy/move constructor for a non-union class X performs a memberwise copy/move of its bases and members. If any operation would cause size() to exceed max_size(), that operation shall throw an exception object of type length_error. A non-type template-argument is dependent if its type is dependent or the constant expression it specifies is value-dependent. The use of a default argument in a function call causes specializations in the default argument to be implicitly instantiated. There are two forms of explicit instantiation: an explicit instantiation definition and an explicit instantiation declaration. A call signature is the name of a return type followed by a parenthesized comma-separated list of zero or more argument types. Fences cannot, in general, be used to restore sequential consistency for atomic operations with weaker ordering specifications. Unless initialized with ATOMIC_FLAG_INIT, it is unspecified whether an atomic_flag object has an initial state of set or clear. The declarations from the namespace nominated by a using-directive become visible in a namespace enclosing the using-directive. If an object is initialized statically, the object is destroyed in the same order as if the object was dynamically initialized. Storage duration is the property of an object that defines the minimum potential lifetime of the storage containing the object. The member-specification in a class definition declares the full set of members of the class; no member can be added elsewhere. A forward_list also satisfies all of the requirements for an allocator-aware container (Table [tab:containers.allocatoraware]). Standard conversions are implicit conversions with built-in meaning. Clause [conv] enumerates the full set of such conversions. If P_i designates an array, the cv-qualifiers cv_i+1 on the element type are also taken as the cv-qualifiers cv_i of the array. enum-specifiers, class-specifiers, and typename-specifiers are discussed in [dcl.enum], Clause [class, temp.res], respectively. In a using-declaration that does not name a constructor, all members of the set of introduced declarations shall be accessible. An initializer-list is ill-formed if the number of initializer-clauses exceeds the number of members or elements to initialize. a thrown exception does not propagate to other threads unless caught, stored, and rethrown using appropriate library functions. Where class-name ::~~class-name is used, the two class-names shall refer to the same class; this notation names the destructor. The conversion is to ``pointer to noexcept function'' if the function call operator has a non-throwing exception specification. The cv-unqualified versions of the object type and of the type designated by the pseudo-destructor-name shall be the same type. The conversion is ill-formed when attempting to convert an expression of class type to an inaccessible or ambiguous base class. The result of the noexcept operator is true if the set of potential exceptions of the expression is empty, and false otherwise. The value computations of the operands of an operator are sequenced before the value computation of the result of the operator. Under a freestanding implementation, it is implementation-defined whether a program can have more than one thread of execution. Constant none is shown in each option group for purposes of exposition; implementations shall provide only a single definition. All iterators i for which the expression (*i).m is well-defined, support the expression i->m with the same semantics as (*i).m. Since only random access iterators provide + and - operators, the library provides two function templates advance and distance. The behavior of a program is undefined if calls to standard library functions from different threads may introduce a data race. Values of type messages_base::catalog usable as arguments to members get and close can be obtained only by calling member open. and the constructor or user-defined conversion function is a candidate by user-defined conversion sequences are not considered. The second standard conversion sequence converts the result of the user-defined conversion to the target type for the sequence. When an argument is an initializer list, it is not an expression and special rules apply for converting it to a parameter type. The implementation can process and skip sections of source files conditionally, include other source files, and replace macros. The contents and meaning of the header are the same as the C standard library header . See also: ISO C 7.30 A non-type argument is non-specialized if it is the name of a non-type parameter. All other non-type arguments are specialized. Friend declarations do not introduce new names into any scope, either when the template is declared or when it is instantiated. cv_2,n-1 ``pointer to'' cv_2,nT2 The cv-unqualified T1 and T2 are used as the types of A and P respectively for type deduction. Only the signature of a function template specialization is needed to enter the specialization in a set of candidate functions. The timed mutex types are the standard library types std::timed_mutex, std::recursive_timed_mutex, and std::shared_timed_mutex. The class once_flag is an opaque data structure that call_once uses to initialize data without causing a data race or deadlock. Condition variables permit concurrent invocation of the wait, wait_for, wait_until, notify_one and notify_all member functions. The implementation shall provide the template shared_future and two specializations, shared_future and shared_future. class bad_variant_access : public exception public: bad_variant_access() noexcept; virtual const char* what() const noexcept; ; Parallel algorithms shall not participate in overload resolution unless is_execution_policy_v> is true. No translation unit shall contain more than one definition of any variable, function, class type, enumeration type, or template. A name prefixed by a nested-name-specifier that nominates an enumeration type shall represent an enumerator of that enumeration. Types bool, char, char16_t, char32_t, wchar_t, and the signed and unsigned integer types are collectively called integral types. A union of the form union { member-specification } ; is called an anonymous union; it defines an unnamed object of unnamed type. A container calls allocator_traits::construct(m, p, args) to construct an element at p using args, with m == get_allocator(). Erasing n elements from a forward_list is linear in n and the number of calls to the destructor of type T is exactly equal to n. The optional attribute-specifier-seq in a decl-specifier-seq appertains to the type determined by the preceding decl-specifiers. A virtual function declared in a class shall be defined, or declared pure in that class, or both; but no diagnostic is required. A class is abstract if it contains or inherits at least one pure virtual function for which the final overrider is pure virtual. The header provides a macro for documenting C++ program assertions and a mechanism for disabling the assertion checks. Integral promotion is performed on integral or enumeration operands. The type of the result is the type of the promoted operand. Whenever the delete keyword is immediately followed by empty square brackets, it shall be interpreted as the second alternative. The noexcept operator determines whether the evaluation of its operand, which is an unevaluated operand, can throw an exception. If a conversion can be interpreted in more than one way as a static_cast followed by a const_cast, the conversion is ill-formed. An object occupies a region of storage in its period of construction, throughout its lifetime, and in its period of destruction. When ios_base::failure is a synonym for another type it shall provide a nested type failure, to emulate the injected class name. Since iterators are an abstraction of pointers, their semantics is a generalization of most of the semantics of pointers in C++. The result of operator*() on an end-of-stream iterator is undefined. For any other iterator value a char_type value is returned. A character literal that begins with u8, such as u8'w', is a character literal of type char, known as a UTF-8 character literal. Requirements are stated in terms of well-defined expressions that define valid terms of the types that satisfy the requirements. Each bitmask type can be implemented as an enumerated type that overloads certain operators, as an integer type, or as a bitset. Clauses [language.support] through [thread] and Annex [depr] specify the requirements of individual entities within the library. The header defines classes and declares functions that encapsulate and manipulate the information peculiar to a locale. A destructor is invoked implicitly In each case, the context of the invocation is the context of the construction of the object. In a non-delegating constructor, the destructor for each potentially constructed subobject of class type is potentially invoked. In Clause [stmt.stmt], the term substatement refers to the contained statement or statements that appear in the syntax notation. A template-declaration is also a definition if its declaration defines a function, a class, a variable, or a static data member. There are three forms of template-argument, corresponding to the three forms of template-parameter: type, non-type and template. If a template parameter is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails. A friend of a class is a function or class that is given permission to use the private and protected member names from the class. Table [tab:containers.sequence.optional] lists operations that are provided for some types of sequence containers but not others. A nodeclspec-function-declaration can only be used in a template-declaration, explicit-instantiation, or explicit-specialization. The explicit specifier shall be used only in the declaration of a constructor or conversion function within its class definition. Unlike other declarative regions, the definition of a namespace can be split over several parts of one or more translation units. The carries_dependency attribute does not change the meaning of the program, but may result in generation of more efficient code. The ambiguity can be avoided by use of copy-initialization or list-initialization syntax, or by use of a non-function-style cast. An aggregate that is a class can also be initialized with a single expression not enclosed in braces, as described in [dcl.init]. If there are fewer initializers than there are array elements, each element not explicitly initialized shall be zero-initialized. Ignoring appearances in initializers of init-captures, an identifier or this shall not appear more than once in a lambda-capture. because the name of a class is inserted in its class scope, the name of a class is also considered a nested member of that class. The strengthening is not permanent and not necessarily in place for the rest of the lifetime of the affected thread of execution. Every implementation is required to supply overloaded operators on fpos objects to satisfy the requirements of [fpos.operations]. Each seek member function begins execution by constructing an object of class sentry. It returns by destroying the sentry object. The class basic_istringstream supports reading objects of class basic_string. The class basic_ostringstream supports writing objects of class basic_string. Pathnames are formatted according to the generic pathname format grammar or an operating system dependent native pathname format. If the value of a character literal prefixed by u, u8, or U is outside the range defined for its type, the program is ill-formed. The specializations required in Table [tab:localization.category.facets] convert the implementation-defined native character set. Note that cv-qualifiers on the type of objects are significant in overload resolution for both glvalue and class prvalue objects. Because ., .*, and :: cannot be overloaded, these operators are always built-in operators interpreted according to Clause [expr]. operator-> shall be a non-static member function taking no parameters. It implements the class member access syntax that uses ->. A preprocessing directive of the form # line pp-tokens new-line (that does not match one of the two previous forms) is permitted. The declaration order is mandated to ensure that base and member subobjects are destroyed in the reverse order of initialization. A label declared in a substatement of a constexpr if statement shall only be referred to by a statement in the same substatement. A return statement with no operand shall be used only in a function whose return type is cv void, a constructor, or a destructor. A non-type non-reference template-parameter is a prvalue. It shall not be assigned to or in any other way have its value changed. The class shared_timed_mutex shall satisfy all of the requirements for shared timed mutexes. It shall be a standard-layout class. A lock is said to own a lockable object if it is currently managing the ownership of that lockable object for an execution agent. Some lock constructors take tag types which describe what should be done with the lockable object during the lock's construction. A waiting function of an asynchronous return object is one that potentially blocks to wait for the shared state to be made ready. The library provides the function template declval to simplify the definition of expressions which occur as unevaluated operands. The allocator_arg_t struct is an empty structure type used as a unique type to disambiguate constructor and function overloading. The potential scope of a template parameter name begins at its point of declaration and ends at the end of its declarative region. The extract members invalidate only iterators to the removed element; pointers and references to the removed element remain valid. Function-definitions are described in [dcl.fct.def] and template-declarations and deduction-guides are described in Clause [temp]. An opaque-enum-declaration is either a redeclaration of an enumeration in the current scope or a declaration of a new enumeration. In a using-declaration used as a member-declaration, the nested-name-specifier shall name a base class of the class being defined. If the text of an alternative is too long to fit on a line, the text is continued on subsequent lines indented from the first one. Pathname resolution is the operating system dependent mechanism for resolving a pathname to a particular file in a file hierarchy. If F's semantics specifies a `Requires:' element, then that requirement is logically imposed prior to the equivalent-to semantics. Requirements specified in terms of interactions between threads do not apply to programs having only a single thread of execution. Whether there is one global locale object for the entire program or one global locale object per thread is implementation-defined. A locale object may be extended with a new facet simply by constructing it with an instance of a class derived from locale::facet. Calling operator++ explicitly, as in expressions like a.operator++(2), has no special properties: The argument to operator++ is 2. The ud-suffix of the user-defined-string-literal or the identifier in a literal-operator-id is called a literal suffix identifier. For every cv-qualified or cv-unqualified object type T, there exist candidate operator functions of the form @T@& operator*(@T@*); For every promoted arithmetic type T, there exist candidate operator functions of the form @T@ operator+(@T@); @T@ operator-(@T@); A ## preprocessing token shall not occur at the beginning or at the end of a replacement list for either form of macro definition. A conversion function may be explicit, in which case it is only considered as a user-defined conversion for direct-initialization. the order in which objects with static or thread storage duration are initialized is described in [basic.start.dynamic, stmt.dcl]. The destructor for a block-scope object with static or thread storage duration will be executed if and only if it was constructed. The defined types for int_type, pos_type, off_type, and state_type shall be int, streampos, streamoff, and mbstate_t respectively. No operation invoked by the offsetof macro shall throw an exception and noexcept(offsetof(type, member-designator)) shall be true. A template parameter pack that is a pack expansion shall not expand a parameter pack declared in the same template-parameter-list. When looking for the declaration of a name used in a template definition, the usual lookup rules are used for non-dependent names. An explicit instantiation for a member template is placed in the namespace where the enclosing class or class template is defined. All of the algorithms are separated from the particular implementations of data structures and are parameterized by iterator types. Unless otherwise specified, algorithms that take function objects as arguments are permitted to copy those function objects freely. The point of declaration for a function-local predefined variable is immediately before the function-body of a function definition. Multiply qualified names, such as N1::N2::N3::n, can be used to refer to members of nested classes or members of nested namespaces. Members of a class are data members, member functions, nested types, enumerators, and member templates and specializations thereof. deque is the data structure of choice when most insertions and deletions take place at the beginning or at the end of the sequence. For unordered containers where the value type is the same as the key type, both iterator and const_iterator are constant iterators. The iterator types iterator and const_iterator of an unordered associative container are of at least the forward iterator category. A using-declaration is a declaration and can therefore be used repeatedly where (and only where) multiple declarations are allowed. The attribute-token fallthrough shall appear at most once in each attribute-list and no attribute-argument-clause shall be present. Appearance of a nodiscard call as a potentially-evaluated discarded-value expression is discouraged unless explicitly cast to void. Because of the conversion rules that apply to +, if E1 is an array and E2 an integer, then E1[E2] refers to the E2-th member of E1. Operators can be overloaded, that is, given meaning when applied to expressions of class type~(Clause [class]) or enumeration type. A pointer can be explicitly converted to any integral type large enough to hold it. The mapping function is implementation-defined. When an expression that has integral type is added to or subtracted from a pointer, the result has the type of the pointer operand. Each formatted input function begins execution by constructing an object of class sentry with the noskipws (second) argument false. All input iterators i support the expression *i, resulting in a value of some object type T, called the value type of the iterator. All the categories of iterators require only those functions that are realizable for a given category in constant time (amortized). Algorithms on output iterators should never attempt to pass through the same iterator twice. They should be single pass algorithms. Each library clause contains the following elements, as applicable: To save space, items that do not apply to a Clause are omitted. Because computers are finite, C++ implementations are inevitably limited in the size of the programs they can successfully process. A decl-specifier in the decl-specifier-seq of a conversion function (if any) shall be neither a defining-type-specifier nor static. The conversion-type-id in a conversion-function-id is the longest sequence of tokens that could possibly form a conversion-type-id. The substatement in an iteration-statement implicitly defines a block scope which is entered and exited each time through the loop. The type size_t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object. The class bad_alloc defines the type of objects thrown as exceptions by the implementation to report a failure to allocate storage. When parsing a template-argument-list, the first non-nested > is taken as the ending delimiter rather than a greater-than operator. For a given template and a given set of template-arguments, An implementation is not required to diagnose a violation of this rule. The member functions whose names end in _for take an argument that specifies a duration. These functions produce relative timeouts. For each tuple assignment operator, an exception is thrown only if the assignment of one of the types in Types throws an exception. All specializations of the default allocator satisfy the allocator completeness requirements [allocator.requirements.completeness]. Placeholders should be defined as: constexpr @unspecified@ _1; If they are not, they shall be declared as: extern @unspecified@ _1; The equivalence to which we refer is not necessarily an operator==, but an equivalence relation induced by the strict weak ordering. A name ``looked up in the context of an expression'' is looked up as an unqualified name in the scope where the expression is found. The name of a function declared in block scope and the name of a variable declared by a block scope extern declaration have linkage. If constant initialization is not performed, a variable with static storage duration or thread storage duration is zero-initialized. If an allocation function that has a non-throwing exception specification fails to allocate storage, it shall return a null pointer. A program that attempts to modify an object through a nonmodifiable lvalue expression or through an rvalue expression is ill-formed. Object types have alignment requirements which place restrictions on the addresses at which an object of that type may be allocated. every over-aligned type is or contains a class type to which extended alignment applies (possibly through a non-static data member). Within a class definition, a member shall not be declared with the thread_local storage-class-specifier unless also declared static. In the definition at namespace scope, the name of the static data member shall be qualified by its class name using the :: operator. The attribute-specifier-seq affects the type only for the declaration it appears in, not other declarations involving the same type. The attribute-specifier-seq affects the type only for the declaration it appears in, not other declarations involving the same type. A declarator can specify an initial value for the identifier being declared. The identifier designates a variable being initialized. A function with the same name but a different parameter list as a virtual function is not necessarily virtual and does not override. Alternatives are listed on separate lines except in a few cases where a long set of alternatives is marked by the phrase ``one of.'' Operators can be regrouped according to the usual mathematical rules only where the operators really are associative or commutative. The evaluation of a full-expression can include the evaluation of subexpressions that are not lexically part of the full-expression. Except where noted, evaluations of operands of individual operators and of subexpressions of individual expressions are unsequenced. The descriptions of the individual formatted output functions describe how they perform output and do not mention the sentry object. If the formulation of a complexity requirement calls for a negative number of operations, the actual requirement is zero operations. A preprocessing directive of the form # include pp-tokens new-line (that does not match one of the two previous forms) is permitted. A program is ill-formed if a destructor that is potentially invoked is deleted or not accessible from the context of the invocation. The expression offsetof(type, member-designator) is never type-dependent and it is value-dependent if and only if type is dependent. An explicit instantiation for a member of a class template is placed in the namespace where the enclosing class template is defined. Wrappers can store, copy, and call arbitrary callable objects, given a call signature, allowing functions to be first-class objects. The unordered associative containers defined in [unord] use specializations of the class template hash as the default hash function. A constructor selected to copy or move an object of class type is odr-used even if the call is actually elided by the implementation. Indirection through an invalid pointer value and passing an invalid pointer value to a deallocation function have undefined behavior. The type double provides at least as much precision as float, and the type long double provides at least as much precision as double. For associative containers where the value type is the same as the key type, both iterator and const_iterator are constant iterators. The library provides four unordered associative containers: unordered_set, unordered_map, unordered_multiset, and unordered_multimap. For direct-initialization, a prvalue of type std::nullptr_t can be converted to a prvalue of type bool; the resulting value is false. The enumeration type declared with an enum-key of only enum is an unscoped enumeration, and its enumerators are unscoped enumerators. b_max is the smallest value greater than or equal to max(|e_min| - K, |e_max|) and equal to 2^M-1, where M is a non-negative integer. The attribute-token deprecated can be used to mark names and entities whose use is still allowed, but is discouraged for some reason. To specify type conversions explicitly, and as an argument of sizeof, alignof, new, or typeid, the name of a type shall be specified. ``cv1 T1'' is reference-compatible with ``cv2 T2'' if and cv1 is the same cv-qualification as, or greater cv-qualification than, cv2. A throw-expression whose operand is an integer literal with value zero does not match a handler of pointer or pointer to member type. sizeof(bool) is not required to be 1. When applied to a reference or a reference type, the result is the size of the referenced type. The enum class type copy_options is a bitmask type that specifies bitmask constants used to control the semantics of copy operations. The supplied version of the header shall declare at least the functions abort, atexit, at_quick_exit, exit, and quick_exit. A translation unit that includes a standard library header shall not #define or #undef names declared in any standard library header. In a constructor declaration, each decl-specifier in the optional decl-specifier-seq shall be friend, inline, explicit, or constexpr. A copy/move constructor for class X is trivial if it is not user-provided and if: otherwise the copy/move constructor is non-trivial. The substatement in a selection-statement (each substatement, in the else form of the if statement) implicitly defines a block scope. A template-argument for a non-type template-parameter shall be a converted constant expression of the type of the template-parameter. For simple function names, argument dependent lookup applies even when the function name is not visible within the scope of the call. If a name can be reached by several paths through a multiple inheritance graph, the access is that of the path that gives most access. If the initialization of a non-local variable with static or thread storage duration exits via an exception, std::terminate is called. The intent is to have operator new() implementable by calling std::malloc() or std::calloc(), so the rules are substantially the same. If a request for a specific extended alignment in a specific context is not supported by an implementation, the program is ill-formed. As a special case, an unnamed bit-field with a width of zero specifies alignment of the next bit-field at an allocation unit boundary. Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. Attributes specify additional information for various source constructs such as types, variables, names, blocks, or translation units. During the lookup for a base class name, non-type names are ignored. If the name found is not a class-name, the program is ill-formed. In a noexcept-specification, the constant-expression, if supplied, shall be a contextually converted constant expression of type bool. Any exception-specification specified on a lambda-expression applies to the corresponding function call operator or operator template. An lvalue of type ``cv1 T1'' can be cast to type ``rvalue reference to cv2 T2'' if ``cv2 T2'' is reference-compatible with ``cv1 T1''. A call to a destructor generated at the end of the lifetime of an object other than a temporary object is an implicit full-expression. Constructors and destructors for static objects can access these objects to read input from stdin or write output to stdout or stderr. Some constraints are: Each sequence is characterized by three pointers which, if non-null, all point into the same charT array object. If an implementation cannot provide any reasonable behavior, the implementation shall report an error as specified in [fs.err.report]. Programs recursively walking directory trees for purposes of removing and renaming entries may wish to avoid following symbolic links. In all respects of the language, each alternative token behaves the same, respectively, as its primary token, except for its spelling. The diagnostics library provides a consistent framework for reporting errors in a C++ program, including predefined exception classes. The thread support library provides components to create and manage threads, including mutual exclusion and interthread communication. If a type cannot be used with a particular allocator, the allocator class or the call to construct or destroy may fail to instantiate. namespace std template class numpunct_byname : public numpunct // this class is specialized for char and wchar_t. In unqualified function calls, the name is not qualified by an -> or . operator and has the more general form of a primary-expression. If the keyword this is not in scope or refers to another class, then a contrived object of type T becomes the implied object argument. Copy elision is required where an expression is evaluated in a context requiring a constant expression and in constant initialization. Because an alias-declaration cannot declare a template-id, it is not possible to partially or explicitly specialize an alias template. An instantiated template specialization can be either implicitly instantiated for a given argument list or be explicitly instantiated. A thread that owns a recursive_mutex object may acquire additional levels of ownership by calling lock() or try_lock() on that object. The semantics of parallel algorithms invoked with an execution policy object of implementation-defined type are implementation-defined. The scope of a declaration is the same as its potential scope unless the potential scope contains another declaration of the same name. Scalar types, trivial class types, arrays of such types and cv-qualified versions of these types are collectively called trivial types. Member functions and static data members of a nested class can be defined in a namespace scope enclosing the definition of their class. An lvalue or rvalue of type ``array of N T'' or ``array of unknown bound of T'' can be converted to a prvalue of type ``pointer to T''. Declarations containing the decl-specifier typedef declare identifiers that can be used later for naming fundamental or compound types. An attribute-specifier-seq shall not appear in an elaborated-type-specifier unless the latter is the sole constituent of a declaration. The names in the default argument are bound, and the semantic constraints are checked, at the point where the default argument appears. In a derived class, if a virtual member function of a base class subobject has more than one final overrider the program is ill-formed. Many binary operators that expect operands of arithmetic or enumeration type cause conversions and yield result types in a similar way. Abbreviating postfix-expression.id-expression as E1.E2, E1 is called the object expression. If E2 is a bit-field, E1.E2 is a bit-field. If a deallocation function with a parameter of type std::size_t is used, the size of the block is passed as the corresponding argument. File types include regular files and directories. Other types of files, such as symbolic links, may be supported by the implementation. The C++ standard library also makes available the facilities of the C standard library, suitably adjusted to ensure static type safety. If there is no ``..._byname'' version of a facet, the base class implements named locale semantics itself by reference to other facets. Flowing off the end of a constructor, a destructor, or a function with a cv void return type is equivalent to a return with no operand. A function template can be overloaded either by (non-template) functions of its name or by (other) function templates of the same name. The member functions whose names end in _until take an argument that specifies a time point. These functions produce absolute timeouts. The struct piecewise_construct_t is an empty structure type used as a unique type to disambiguate constructor and function overloading. When a friend declaration refers to an overloaded name or operator, only the function specified by the parameter types becomes a friend. Each parallel algorithm overload has an additional template type parameter named ExecutionPolicy, which is the first template parameter. The name declared in an exception-declaration is local to the handler and shall not be redeclared in the outermost block of the handler. A value of type std::nullptr_t is a null pointer constant. Such values participate in the pointer and the pointer to member conversions. Even if the implementation defines two or more basic types to have the same value representation, they are nevertheless different types. The default construct in std::allocator will call ::new((void*)p) T(args), but specialized allocators may choose a different definition. References and pointers to an element obtained while it is owned by a node_type are invalidated if the element is successfully inserted. References and pointers to an element obtained while it is owned by a node_type are invalidated if the element is successfully inserted. Unlike vectors and deques, fast random access to list elements is not supported, but many algorithms only need sequential access anyway. A constexpr specifier used in the declaration of a function that is not a constructor declares that function to be a constexpr function. If the type of an entity with an undeduced placeholder type is needed to determine the type of an expression, the program is ill-formed. The init-declarator-list appearing in a declaration is a comma-separated sequence of declarators, each of which can have an initializer. A handler is no longer considered active when the catch clause exits or when std::unexpected() exits after being entered due to a throw. The cast and assignment operators must still perform their specific conversions as described in [expr.cast, expr.static.cast, expr.ass]. The least requirements on a conforming implementation are: These collectively are referred to as the observable behavior of the program. The library defines a number of atomic operations and operations on mutexes that are specially identified as synchronization operations. Each subclause also provides a summary, listing the headers specified in the subclause and the library entities provided in each header. Descriptions of class member functions follow the order (as appropriate): To save space, items that do not apply to a class are omitted. A requirement is optional if the last column of Table [tab:utilities.allocator.requirements] specifies a default for a given expression. An implementation may strengthen the exception specification for a non-virtual function by adding a non-throwing noexcept-specification. The class locale::id provides identification of a locale facet interface, used as an index for lookup and to encapsulate initialization. To create a new facet interface, C++ programs simply derive from locale::facet a class containing a static member: static locale::id id. If no sequence of conversions can be found to convert an argument to a parameter type, an implicit conversion sequence cannot be formed. The identities among certain predefined operators applied to basic types (for example, ++a = a+=1) need not hold for operator functions. The implicitly-defined copy/move assignment operator for a non-union class X performs memberwise copy/move assignment of its subobjects. User-defined types should define their own implicit conversions to std::basic_string_view in order to interoperate with these functions. The behavior of any function other than a POF used as a signal handler in a C++ program is implementation-defined. See also: ISO C~7.14. An expression of the form &qualified-id where the qualified-id names a dependent member of the current instantiation is value-dependent. An explicit specialization may be declared for a function template, a class template, a member of a class template or a member template. The common type of two time_point types is a time_point with the same clock as the two types and the common type of their two durations. For each integral type integral, the specialization atomic provides additional atomic operations appropriate to integral types. A name used in global scope, outside of any function, class or user-declared namespace, shall be declared before its use in global scope. A non-local variable with static storage duration having initialization with side effects must be initialized even if it is not odr-used. There is a distinct object or reference per thread, and use of the declared name refers to the entity associated with the current thread. M(X) is the set of the types of all non-base-class subobjects that are guaranteed in a standard-layout class to be at a zero offset in X. A non-static member function may be declared const, volatile, or const volatile. These cv-qualifiers affect the type of the this pointer. If a static data member is not declared thread_local there is one copy of the data member that is shared by all the objects of the class. An associative container supports unique keys if it may contain at most one element for each key. Otherwise, it supports equivalent keys. In C++ class and array prvalues can have cv-qualified types. This differs from ISO C, in which non-lvalues never have cv-qualified types. A declaration that declares a function or defines a class, namespace, template, or function also has one or more scopes nested within it. If the function declarator includes a trailing-return-type, that trailing-return-type specifies the declared return type of the function. A declaration with several declarators is usually equivalent to the corresponding sequence of declarations each with a single declarator. In a function-definition, either void declarator ; or declarator ; shall be a well-formed function declaration as described in [dcl.fct]. For each distinct base class that is specified virtual, the most derived object shall contain a single base class subobject of that type. The identifier in a simple-capture is looked up using the usual rules for unqualified name lookup; each such lookup shall find an entity. It is unspecified whether additional unnamed non-static data members are declared in the closure type for entities captured by reference. It is not safe to concurrently update two bit-fields in the same struct if all fields between them are also bit-fields of non-zero width. POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc. All rights in these originals are reserved. As a design practice, preconditions are not specified when it is unreasonable for a program to detect them prior to calling the function. The normal form for a path ending in a directory-separator that is not the root directory has a current directory (dot) element appended. In translation phase 1, a universal-character-name is introduced whenever an actual extended character is encountered in the source text. If X::propagate_on_container_swap::value is true, lvalues of type X shall be swappable and the swap operation shall not throw exceptions. There also exist candidate operator functions of the form bool operator!(bool); bool operator&&(bool, bool); bool operator||(bool, bool); As indicated by the syntax, a preprocessing token shall not follow a #else or #endif directive before the terminating new-line character. If no case constant matches the condition, and if there is a default label, control passes to the statement labeled by the default label. A template parameter pack that is a parameter-declaration whose type contains one or more unexpanded parameter packs is a pack expansion. The act of instantiating a function, a class, a member of a class template or a member template is referred to as template instantiation. If a class template has been declared, but not defined, at the point of instantiation, the instantiation yields an incomplete class type. Implicitly instantiated class, function, and variable template specializations are placed in the namespace where the template is defined. An explicit instantiation of a function template or member function of a class template shall not use the inline or constexpr specifiers. If a template parameter is named Predicate, operator() applied to the template argument shall return a value that is convertible to bool. A class name or enumeration name can be hidden by the name of a variable, data member, function, or enumerator declared in the same scope. [stmt.dcl] describes the initialization of local static variables; [basic.start.term] describes the destruction of local static variables. A static local variable or local type in a member function always refers to the same entity, whether or not the member function is inline. A node handle is an object that accepts ownership of a single element from an associative container or an unordered associative container. For unordered associative containers where the key type and value type are the same, both iterator and const_iterator are const iterators. In a two's complement representation, this conversion is conceptual and there is no change in the bit pattern (if there is no truncation). At most one storage-class-specifier shall appear in a given decl-specifier-seq, except that thread_local may appear with static or extern. If a function f is called where f was previously declared with the noreturn attribute and f eventually returns, the behavior is undefined. The implementation is free to allocate the array in read-only memory if an explicit array with the same initializer could be so allocated. The class error_category serves as a base class for types used to identify the source and encoding of a particular category of error code. An attribute-specifier-seq in a lambda-declarator appertains to the type of the corresponding function call operator or operator template. If a lambda-capture includes a capture-default that is &, no identifier in a simple-capture of that lambda-capture shall be preceded by &. The negative of an unsigned quantity is computed by subtracting its value from 2^n, where n is the number of bits in the promoted operand. The type of that object is the allocated type. This type shall be a complete object type, but not an abstract class type or array thereof. Unlike &, && guarantees left-to-right evaluation: the second operand is not evaluated if the first operand is false. The result is a bool. The relation ``is dependency-ordered before'' is analogous to ``synchronizes with'', but uses release/consume in place of release/acquire. When throwing ios_base::failure exceptions, implementations should provide values of ec that identify the specific reason for the failure. A header is not necessarily a source file, nor are the sequences delimited by < and > in header names necessarily valid source file names. Top level namespaces with a name starting with std and followed by a non-empty sequence of digits are reserved for future standardization. An implementation shall not declare any standard library function signature as constexpr except for those where it is explicitly required. The implementation-defined value of member table_size is at least 256. Only the char (not unsigned char and signed char) form is provided. For every T, where T is a pointer to object type, there exist candidate operator functions of the form std::ptrdiff_t operator-(@T@, @T@); A preprocessing directive of the form # undef identifier new-line causes the specified identifier no longer to be defined as a macro name. If there is no user-declared constructor for class X, a non-explicit constructor having no parameters is implicitly declared as defaulted. Except where otherwise specified, the provisions of [basic.stc.dynamic] apply to the library versions of operator new and operator delete. The name lookup rules are used to associate the use of a name with a template declaration; that is, to identify a name as a template-name. When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation. If P is a forwarding reference and the argument is an lvalue, the type ``lvalue reference to A'' is used in place of A for type deduction. The header defines a class template and several related functions for representing and manipulating fixed-size sequences of bits. A name used in the handler for a function-try-block is looked up as if the name was used in the outermost block of the function definition. The declaration of a class name takes effect immediately after the identifier is seen in the class definition or elaborated-type-specifier. The type of a non-static member function is an ordinary function type, and the type of a non-static data member is an ordinary object type. A member function definition that appears outside of the class definition shall appear in a namespace scope enclosing the class definition. Each associative container is parameterized on Key and an ordering relation Compare that induces a strict weak ordering on elements of Key. Two values k1 and k2 of type Key are considered equivalent if the container's key equality predicate returns true when passed those values. A base class subobject might have a polymorphic behavior different from the polymorphic behavior of a most derived object of the same type. The expression E1->E2 is converted to the equivalent form (*(E1)).E2; the remainder of [expr.ref]~will address only the first option (dot). An xvalue of type ``cv1 B'' can be cast to type ``rvalue reference to cv2 D'' with the same constraints as for an lvalue of type ``cv1 B''. Two expression evaluations conflict if one of them modifies a memory location and the other one reads or modifies the same memory location. [TeXComm "defncontext" [FixArg (TeXRaw "of other types of files")]] a directory containing a directory entry for the file under discussion. An object of type directory_iterator provides an iterator for a sequence of directory_entry elements representing the files in a directory. A program is ill-formed if one of its translation units contains an integer literal that cannot be represented by any of the allowed types. Whether a name from the C standard library declared with external linkage has extern "C" or extern "C++" linkage is implementation-defined. All implementations for which standard time units are meaningful must necessarily have a steady clock within their hardware implementation. instantiations of clock, time point and duration types supplied by the implementation as specified in [time.clock] do not throw exceptions. The struct nullopt_t is an empty structure type used as a unique type to indicate the state of not containing a value for optional objects. In a member function definition, the declaration of a name at block scope hides the declaration of a member of the class with the same name. User-defined operators are functions, and the categories of values they expect and yield are determined by their parameter and return types. If a node handle is not empty, then it contains an allocator that is equal to the allocator of the container when the element was extracted. Inserting n elements into a forward_list is linear in n, and the number of calls to the copy or move constructor of T is exactly equal to n. If the definition of a function or variable appears in a translation unit before its first declaration as inline, the program is ill-formed. If a cv-qualifier appears in a decl-specifier-seq, the init-declarator-list or member-declarator-list of the declaration shall not be empty. Every implementation shall provide for linkage to functions written in the C programming language, "C", and linkage to C++ functions, "C++". The attribute-token nodiscard may be applied to the declarator-id in a function declaration or to the declaration of a class or enumeration. For compatibility with the C standard library, the C++ standard library provides the 26 C headers, as shown in Table [tab:future.c.headers]. `Effects:' is_literal_type has a base-characteristic of true_type if T is a literal type, and a base-characteristic of false_type otherwise. If the encoding being converted to has no representation for source characters, the resulting converted characters, if any, are unspecified. Iterators are a generalization of pointers that allow a C++ program to work with different data structures (containers) in a uniform manner. All specializations of istreambuf_iterator shall have a trivial copy constructor, a constexpr default constructor, and a trivial destructor. Alternative token representations are provided for some operators and punctuators. These include ``digraphs'' and additional reserved words. Any of the functions defined in the C++ standard library can report a failure by throwing an exception of a type described in its paragraph. A prefix unary operator shall be implemented by a non-static member function with no parameters or a non-member function with one parameter. Each occurrence of white space between the argument's preprocessing tokens becomes a single space character in the character string literal. Placemarker preprocessing tokens do not appear in the syntax because they are temporary entities that exist only within translation phase 4. The materialization of a temporary object is generally delayed as long as possible in order to avoid creating unnecessary temporary objects. So that several statements can be used where one is expected, the compound statement (also, and equivalently, called ``block'') is provided. The class bad_typeid defines the type of objects thrown as exceptions by the implementation to report a null pointer in a typeid expression. When a function is defined in a friend function declaration in a class template, the function is instantiated when the function is odr-used. The type replacing the placeholder in the type of the value synthesized for a non-type template parameter is also a unique synthesized type. The types of the template-parameters in the template-parameter-list shall be the same as those specified in the primary template definition. Remove any top-level cv-qualifiers: If A was transformed from a function parameter pack and P is not a parameter pack, type deduction fails. The behavior of a program is undefined if it destroys a mutex object owned by any thread or a thread terminates while owning a mutex object. A thread shall call unlock() once for each level of ownership acquired by calls to lock(), try_lock(), try_lock_for(), and try_lock_until(). Specializations of shared_ptr shall be CopyConstructible, CopyAssignable, and LessThanComparable, allowing their use in standard containers. In the description of the algorithms operators + and - are used for some of the iterator categories for which they do not have to be defined. There shall be a specialization atomic which provides the general atomic operations as specified in [atomics.types.operations.general]. The macro ATOMIC_FLAG_INIT shall be defined in such a way that it can be used to initialize an object of type atomic_flag to the clear state. A variable with thread storage duration shall be initialized before its first odr-use and, if constructed, shall be destroyed on thread exit. A program-supplied allocation function can obtain the address of the currently installed new_handler using the std::get_new_handler function. Type wchar_t shall have the same size, signedness, and alignment requirements as one of the other integral types, called its underlying type. If a class is marked with the class-virt-specifier final and it appears as a base-type-specifier in a base-clause, the program is ill-formed. The local class is in the scope of the enclosing scope, and has the same access to names outside the function as does the enclosing function. In containers that support equivalent keys, elements with equivalent keys are adjacent to each other in the iteration order of the container. The headers , , , , and define class templates that meet the requirements for sequence containers. Syntactic components beyond those found in the general form of declaration are added to a function declaration to make a function-definition. In a given scope, a typedef specifier shall not be used to redefine the name of any type declared in that scope to refer to a different type. In that sense, a decltype-specifier is analogous to a use of a typedef-name, so the usual reasons for requiring a complete type do not apply. During name lookup in a class hierarchy, some ambiguities may be resolved by considering whether one member hides the other along some paths. As described above, the braces around the initializer-clause for a union member can be omitted if the union is a member of another aggregate. The currently handled exception is rethrown if control reaches the end of a handler of the function-try-block of a constructor or destructor. The instantiated generic lambda's return type and parameter types shall match the return type and parameter types of the pointer to function. The operand of the unary + operator shall have arithmetic, unscoped enumeration, or pointer type and the result is the value of the argument. If that portion of the array previously provided storage for another object, the lifetime of that object ends because its storage was reused. It is permissible for an implementation to be dependent upon an operating system emulator rather than the actual underlying operating system. [utility.arg.requirements] describes requirements on types and expressions used to instantiate templates defined in the C++ standard library. Clauses [language.support] through [thread] and Annex [depr] describe the behavior of numerous functions defined by the C++ standard library. In successive calls to a locale facet member function on a facet object installed in the same locale, the returned result shall be identical. Each locale category, in turn, identifies a set of locale facets, including at least those shown in Table [tab:localization.category.facets]. In a class template declaration, if the class name is a simple-template-id, the declaration declares a class template partial specialization. The > token following the template-parameter-list of a type-parameter may be the product of replacing a >> token by two consecutive > tokens. A template-argument for a template template-parameter shall be the name of a class template or an alias template, expressed as id-expression. The instantiation of a sizeof... expression produces an integral constant containing the number of elements in the parameter pack it expands. Each type nominated above from the parameter template and the corresponding type from the argument template are used as the types of P and A. The type classification traits describe a complete taxonomy of all possible C++ types, and state where in that taxonomy a given type belongs. Vectorization-unsafe standard library functions may not be invoked by user code called from execution::parallel_unsequenced_policy algorithms. Exactly one definition of a class is required in a translation unit if the class is used in a way that requires the class type to be complete. All variables which do not have dynamic storage duration, do not have thread storage duration, and are not local have static storage duration. If a standard-layout class object has any non-static data members, its address is the same as the address of its first non-static data member. Every iterator referring to an element in one container before the swap shall refer to the same element in the other container after the swap. A storage-class-specifier other than thread_local shall not be specified in an explicit specialization or an explicit instantiation directive. The size of the smallest bit-field large enough to hold all the values of the enumeration type is max(M,1) if b_min is zero and M+1 otherwise. The first declaration of a function shall specify the noreturn attribute if any declaration of that function specifies the noreturn attribute. The order of derivation is not significant except as specified by the semantics of initialization by constructor, cleanup, and storage layout. The function std::current_exception() and the class std::nested_exception can be used by a program to capture the currently handled exception. The forwarding call wrapper g returned by a call to bind(f, bound_args...) shall have a nested type result_type defined as a synonym for R. Annex [diff] summarizes the evolution of C++ since its first published description, and explains in detail the differences between C++ and C@. If the subobject contains a reference member or a const subobject, the name of the original subobject cannot be used to access the new object. Evaluations A and B are indeterminately sequenced when either A is sequenced before B or B is sequenced before A, but it is unspecified which. The value of a non-atomic scalar object or bit-field M, as determined by evaluation B, shall be the value stored by the visible side effect A. The class template specialization basic_streambuf serves as a base class for class templates basic_stringbuf and basic_filebuf. The more obvious use of ios_base::hex to specify hexadecimal floating-point format would change the meaning of existing well defined programs. Function arguments that take character sequences representing paths may use the generic pathname format grammar or the native pathname format. the current value of all non-static class members of an object The state of an object can be obtained by using one or more observer functions. Parsing "-1" correctly into, e.g., an unsigned short requires that the corresponding member get() at least extract the sign before delegating. The implicit object parameter, however, retains its identity since no user-defined conversions can be applied to achieve a type match with it. When the parameter has a class type and the argument expression has the same type, the implicit conversion sequence is an identity conversion. If multiple constructors are viable but none is better than the others, the implicit conversion sequence is the ambiguous conversion sequence. A new-line character ends the preprocessing directive even if it occurs within what would otherwise be an invocation of a function-like macro. A preprocessing directive of the form # pragma pp-tokens_opt new-line causes the implementation to behave in an implementation-defined manner. The class template template struct char_traits; shall be provided in the header as a basis for explicit specializations. The result (value or exception) of a future object can be set by calling a respective function on an object that shares the same shared state. If a template parameter is named R1 or R2, and the template argument is not a specialization of the ratio template, the program is ill-formed. The implementation shall declare but not define the function templates identified as ``templated operations on atomic types'' in [atomics.syn]. The declarative region of the name of a template parameter of a template is the smallest template-declaration in which the name was introduced. Together, zero-initialization and constant initialization are called static initialization; all other initialization is dynamic initialization. A bit-field of narrow character type whose length is larger than the number of bits in the object representation of that type has padding bits. Anonymous unions declared at block scope shall be declared with any storage class allowed for a block-scope variable, or with no storage class. Except where it has been declared for a class, the subscript operator [] is interpreted in such a way that E1[E2] is identical to *((E1)+(E2)). In the function-body, a function-local predefined variable denotes a block-scope object of static storage duration that is implicitly defined . Given types ``cv1 T1'' and ``cv2 T2'', ``cv1 T1'' is reference-related to ``cv2 T2'' if T1 is the same type as T2, or T1 is a base class of T2. A narrowing conversion is an implicit conversion As indicated above, such conversions are not allowed at the top level in list-initializations. The class runtime_error defines the type of objects thrown as exceptions to report errors presumably detectable only when the program executes. A subexpression e1 of an expression e is an immediate subexpression if there is no subexpression e2 of e such that e1 is a subexpression of e2. The operands of * and / shall have arithmetic or unscoped enumeration type; the operands of % shall have integral or unscoped enumeration type. Several contexts in C++ cause evaluation of a function call, even though no corresponding function call syntax appears in the translation unit. There is a separate order for each atomic object. There is no requirement that these can be combined into a single total order for all objects. The value observed by a load of an atomic depends on the ``happens before'' relation, which depends on the values observed by loads of atomics. The class template basic_stringstream supports reading and writing from objects of class basic_string. A sequence of octal or hexadecimal digits is terminated by the first character that is not an octal digit or a hexadecimal digit, respectively. Two function declarations of the same name refer to the same function if they are in the same scope and have equivalent parameter declarations. A defaulted move constructor or assignment operator that is defined as deleted is excluded from the set of candidate functions in all contexts. The identifier __VA_ARGS__ shall occur only in the replacement-list of a function-like macro that uses the ellipsis notation in the parameters. Temporary objects are destroyed as the last step in evaluating the full-expression that (lexically) contains the point where they were created. A conversion function in a derived class does not hide a conversion function in a base class unless the two functions convert to the same type. Each member function of the form constexpr @return-type@ @F@(charT c, size_type pos); is equivalent to return F(basic_string_view(&c, 1), pos); When a type name is specified in a way that includes a non-deduced context, all of the types that comprise that type name are also non-deduced. The maximum number of execution agents which can share a shared lock on a single shared mutex type is unspecified, but shall be at least 10000. Each template argument specifies the type of an element in the tuple. Consequently, tuples are heterogeneous, fixed-size collections of values. When converting between an object of class bitset and a value of some integral type, bit position pos corresponds to the bit value 1 << pos. Access checking for default arguments in function templates and in member functions of class templates is performed as described in [temp.inst]. An object type imposes an alignment requirement on every object of that type; stricter alignment can be requested using the alignment specifier. Standard-layout classes are useful for communicating with code written in other programming languages. Their layout is specified in [class.mem]. The auto type-specifier is also used to introduce a function type having a trailing-return-type or to signify that a lambda is a generic lambda. [class.cdtor]~describes the behavior of virtual function calls when the object expression refers to an object under construction or destruction. In the remainder of [expr.ref], cq represents either const or the absence of const and vq represents either volatile or the absence of volatile. Unless an object is a bit-field or a base class subobject of zero size, the address of that object is the address of the first byte it occupies. The class template specialization basic_iostream serves as a base class for class templates basic_stringstream and basic_fstream. The header defines four class templates and eight types that associate stream buffers with files and assist reading and writing files. An allocator may constrain the types on which it can be instantiated and the arguments for which its construct or destroy members may be called. A call to any of the set_* functions shall synchronize with subsequent calls to the same set_* function and to the corresponding get_* function. locale member functions expecting a category argument require one of the category values defined above, or the union of two or more such values. Extractor and inserter members of the standard iostreams use num_get<> and num_put<> member functions for formatting and parsing numeric values. When overload resolution succeeds, and the best viable function is not accessible in the context in which it is used, the program is ill-formed. The source transformations and constructions defined in these subclauses are only for the purpose of describing the overload resolution process. For the purposes of overload resolution, both static and non-static member functions have an implicit object parameter, but constructors do not. The second operand of operator -> is ignored in selecting an operator-> function, and is not an argument when the operator-> function is called. A default constructor may be an explicit constructor; such a constructor will be used to perform default-initialization or value-initialization. The type nullptr_t is a synonym for the type of a nullptr expression, and it has the characteristics described in [basic.fundamental, conv.ptr]. Specializations (explicit or implicit) of a template that has internal linkage are distinct from all specializations in other translation units. An explicit destructor call for an object that has a type that is a class template specialization may explicitly specify the template-arguments. An explicit specialization of a static data member declared as an array of unknown bound can have a different bound from its definition, if any. A function with the same name as a template and a type that exactly matches that of a template specialization is not an explicit specialization. If a particular P contains no template-parameters that participate in template argument deduction, that P is not used to determine the ordering. A pointer past the end of an object is not considered to point to an unrelated object of the object's type that might be located at that address. For an unordered_multiset the key type and the value type are both Key. The iterator and const_iterator types are both const iterator types. A prvalue of type float can be converted to a prvalue of type double. The value is unchanged. This conversion is called floating point promotion. A null pointer constant of integral type can be converted to a prvalue of type std::nullptr_t. The resulting prvalue is not a null pointer value. If any declaration of a function or function template has a constexpr specifier, then all its declarations shall contain the constexpr specifier. The class template specialization basic_istream serves as a base class for class templates basic_istringstream and basic_ifstream. The class template specialization basic_ostream serves as a base class for class templates basic_ostringstream and basic_ofstream. Functions with template parameters named EcharT shall not participate in overload resolution unless EcharT is one of the encoded character types. For every iterator type X for which equality is defined, there is a corresponding signed integer type called the difference type of the iterator. To make it possible for algorithmic templates to work directly with input/output streams, appropriate iterator-like class templates are provided. Class istreambuf_iterator::proxy provides a temporary placeholder as the return value of the post-increment operator (operator++). The C++ standard library provides definitions for the following types of entities: macros, values, types, templates, classes, functions, objects. The rank of a conversion sequence is determined by considering the rank of each conversion in the sequence and the rank of any reference binding. A binary operator shall be implemented either by a non-static member function with one parameter or by a non-member function with two parameters. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed. If the implicitly-defined constructor would satisfy the requirements of a constexpr constructor, the implicitly-defined constructor is constexpr. A default template-argument may be specified for any kind of template-parameter (type, non-type, template) that is not a template parameter pack. Using the transformed function template's function type, perform type deduction against the other template as described in [temp.deduct.partial]. A lookup that finds an injected-class-name can result in an ambiguity in certain cases (for example, if it is found in more than one base class). An explicit instantiation definition is an instantiation point for the specialization or specializations specified by the explicit instantiation. The standard library templates unique_lock, lock_guard, lock, try_lock, and condition_variable_any all operate on user-supplied lockable objects. The means of setting the result of a shared state is specified in the description of those classes and functions that create such a state object. The relative difference in durations between those reported by a given clock and the SI definition is a measure of the quality of implementation. Both in-place and copying versions are provided for certain algorithms. When such a version is provided for algorithm it is called algorithm_copy. For all algorithms that take Compare, there is a version that uses operator< instead. That is, comp(*i, *j) != false defaults to *i < *j != false. For purposes of determining (during parsing) whether an expression is a postfix-expression for a function call, the usual name lookup rules apply. The type of a pointer to array of unknown size, or of a type defined by a typedef declaration to be an array of unknown size, cannot be completed. Those entries marked ``(Note A)'' or ``(Note B)'' have linear complexity for array and have constant complexity for all other standard containers. Class array relies on the implicitly-declared special member functions to conform to the container requirements table in [container.requirements]. The mutable specifier shall appear only in the declaration of a non-static data member whose type is neither const-qualified nor a reference type. A constexpr specifier used in an object declaration declares the object as const. Such an object shall have literal type and shall be initialized. There is no special provision for a decl-specifier-seq that lacks a type-specifier or that has a type-specifier that only specifies cv-qualifiers. The auto and decltype(auto) type-specifiers are used to designate a placeholder type that will be replaced later by deduction from an initializer. An enumerator-definition without an initializer gives the enumerator the value obtained by increasing the value of the previous enumerator by one. A C language linkage is ignored in determining the language linkage of the names of class members and the function type of class member functions. a derived class and its base class subobjects can be represented by a directed acyclic graph (DAG) where an arrow means ``directly derived from.'' An abstract class can be derived from a class that is not abstract, and a pure virtual function may override a virtual function which is not pure. A ... in a handler's exception-declaration functions similarly to ... in a function parameter declaration; it specifies a match for any exception. If E2 is declared to have type ``reference to T'', then E1.E2 is an lvalue; the type of E1.E2 is T. Otherwise, one of the following rules applies. The binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. The additive operators + and - group left-to-right. The usual arithmetic conversions are performed for operands of arithmetic or enumeration type. The header defines three types that associate stream buffers with character array objects and assist reading and writing such objects. The class template istreambuf_iterator defines an input iterator that reads successive characters from the streambuf for which it was constructed. For every set of well-defined expression requirements there is a table that specifies an initial set of the valid expressions and their semantics. All of the string types, containers (except array), string buffers and string streams, and match_results are parameterized in terms of allocators. Table [tab:utilities.allocator.requirements] describes the requirements on allocator types and thus on types used to instantiate allocator_traits. Implementations may share their own internal objects between threads if the objects are not visible to users and are protected against data races. One initialization strategy is for locale to initialize each facet's id member the first time an instance of the facet is installed into a locale. The specializations required in Table [tab:localization.category.facets], namely collate and collate, apply lexicographic ordering. Some predefined operators, such as +=, require an operand to be an lvalue when applied to basic types; this is not required by operator functions. If a condition can be syntactically resolved as either an expression or the declaration of a block-scope name, it is interpreted as a declaration. Each member function of the form constexpr @return-type@ @F@(const charT* s, size_type pos); is equivalent to return F(basic_string_view(s), pos); The types of the constants defined by macros in are not required to match the types to which the macros refer. See also: ISO C 5.2.4.2.1 If x or xp refers to a non-dependent type or refers to the current instantiation, the type of y is the type of the class member access expression. Implicitly instantiated specializations for members of a class template are placed in the namespace where the enclosing class template is defined. Implementations can extend the behavior of the first overload of async() by adding their extensions to the launch policy under the ``as if'' rule. Specializations of shared_ptr shall be contextually convertible to bool, allowing their use in boolean expressions and declarations in conditions. When a member is redeclared within its class definition, the access specified at its redeclaration shall be the same as at its initial declaration. The access rules for a virtual function are determined by its declaration and are not affected by the rules for a function that later overrides it. The dynamic initialization of non-local variables is described in [basic.start.dynamic]; that of local static variables is described in [stmt.dcl]. Pointers to over-aligned types have no special representation, but their range of valid values is restricted by the extended alignment requirement. If a non-static member function of a class X is called for an object that is not of type X, or of a type derived from X, the behavior is undefined. The declaration of a non-inline static data member in its class definition is not a definition and may be of an incomplete type other than cv void. An unordered associative container supports unique keys if it may contain at most one element for each key. Otherwise, it supports equivalent keys. A prvalue of type ``pointer to cv1 T'' can be converted to a prvalue of type ``pointer to cv2 T'' if ``cv2 T'' is more cv-qualified than ``cv1 T''. A variable declared without a storage-class-specifier at block scope or declared as a function parameter has automatic storage duration by default. Any errors that arise from this instantiation are not in the immediate context of the function type and can result in the program being ill-formed. Functions shall not have a return type of type array or function, although they may have a return type of type pointer or reference to such things. a pointer to member formed from a mutable non-static data member does not reflect the mutable specifier associated with the non-static data member. When the keyword delete in a delete-expression is preceded by the unary :: operator, the deallocation function's name is looked up in global scope. If there is ambiguity about which side effect to a non-atomic object or bit-field is visible, then the behavior is either unspecified or undefined. A path with no redundant current directory (dot) elements, no redundant parent directory (dot-dot) elements, and no redundant directory-separators. The escape \ooo consists of the backslash followed by one, two, or three octal digits that are taken to specify the value of the desired character. In translation phase 6, adjacent string literals are concatenated and user-defined-string-literals are considered string literals for that purpose. The selection of viable functions considers relationships between arguments and function parameters other than the ranking of conversion sequences. Operator functions are usually not called directly; instead they are invoked to evaluate the operators they implement~([over.unary] -- [over.inc]). It determines the constructor to be called if elision is not performed, and the selected constructor must be accessible even if the call is elided. In every specialization basic_string, the type allocator_traits::value_type shall name the same type as charT. The > token following the template-parameter-list of a template-declaration may be the product of replacing a >> token by two consecutive > tokens. Most expressions that use template parameters use non-type template parameters, but it is possible for an expression to reference a type parameter. The in_place_t, in_place_type_t, and in_place_index_t function types are used as unique types to disambiguate constructor and function overloading. A name is a use of an identifier, operator-function-id, literal-operator-id, conversion-function-id, or template-id that denotes an entity or label. Because the name of a template parameter cannot be redeclared within its potential scope, a template parameter's scope is often its potential scope. Static, thread, and automatic storage durations are associated with objects introduced by declarations and implicitly created by the implementation. The term object type includes the cv-qualifiers specified in the decl-specifier-seq, declarator, type-id, or new-type-id when the object is created. The insert and emplace members shall not affect the validity of references to container elements, but may invalidate all iterators to the container. The extern keyword can also be used in explicit-instantiations and linkage-specifications, but it is not a storage-class-specifier in such contexts. A : following ``enum nested-name-specifier_opt identifier'' within the decl-specifier-seq of a member-declaration is parsed as part of an enum-base. If a virtual function is marked with the virt-specifier override and does not override a member function of a base class, the program is ill-formed. If no valid standard conversion from ``pointer to member of B of type T'' to ``pointer to member of D of type T'' exists, the program is ill-formed. ``Relaxed'' atomic operations are not synchronization operations even though, like synchronization operations, they cannot contribute to data races. Two groups of member function signatures share common properties: the formatted input functions (or extractors) and the unformatted input functions. The type of an integer literal is the first of the corresponding list in Table [tab:lex.type.integer.literal] in which its value can be represented. Instead of stating ``class X has to define a member function operator++(),'' the interface requires ``for any object x of class X, ++x is defined.'' Each enumerated type may be implemented as an enumeration or as a synonym for an enumeration. Such as an integer type, with constant integer values. All library entities except macros, operator new and operator delete are defined within the namespace std or namespaces nested within namespace std. Virtual member function signatures defined for a base class in the C++ standard library may be overridden in a derived class defined in the program. The program's definitions are used instead of the default versions supplied by the implementation. Such replacement occurs prior to program startup. Within the sequence of preprocessing tokens making up an invocation of a function-like macro, new-line is considered a normal white-space character. A declaration of a destructor that does not have an exception-specification has the same exception specification as if had been implicitly declared. explicit calls of destructors are rarely needed. One use of such calls is for objects placed at specific addresses using a placement new-expression. The type streampos shall be an implementation-defined type that satisfies the requirements for pos_type in [iostreams.limits.pos, iostream.forward]. The type streamoff shall be an implementation-defined type that satisfies the requirements for off_type in [iostreams.limits.pos, iostream.forward]. During the execution of a parallel algorithm, if the invocation of an element access function exits via an uncaught exception, terminate() is called. If there is a use of an object with static storage duration that does not happen before the object's destruction, the program has undefined behavior. The alignment required for a type might be different when it is used as the type of a complete object and when it is used as the type of a subobject. Two standard-layout struct types are layout-compatible classes if their common initial sequence comprises all members and bit-fields of both classes. An expression e can be implicitly converted to a type T if and only if the declaration T t=e; is well-formed, for some invented temporary variable t. A type denoted in a dynamic-exception-specification shall not denote a pointer or reference to an incomplete type, other than ``pointer to cv void''. if T is a non-class type that is cv-qualified, the cv-qualifiers are discarded when determining the type of the resulting prvalue; see Clause [expr]. The class istrstream supports the reading of objects of class strstreambuf. It supplies a strstreambuf object to control the associated array object. The class ostrstream supports the writing of objects of class strstreambuf. It supplies a strstreambuf object to control the associated array object. The specifications of the synchronization operations define when one reads the value written by another. For atomic objects, the definition is clear. Each unformatted input function begins execution by constructing an object of class sentry with the default argument noskipws (second) argument true. Two groups of member function signatures share common properties: the formatted output functions (or inserters) and the unformatted output functions. An object of class path represents a path and contains a pathname. Such an object is concerned only with the lexical and syntactic aspects of a path. Calling options, depth, recursion_pending, pop or disable_recursion_pending on an iterator that is not dereferenceable results in undefined behavior. Descriptions of function semantics contain the following elements (as appropriate): To save space, items that do not apply to a function are omitted. The set of candidate functions for overload resolution is the union of the member candidates, the non-member candidates, and the built-in candidates. The #ifdef and #ifndef directives, and the defined conditional inclusion operator, shall treat has_include as if it were the name of a defined macro. Braces can be elided in the initializer-list for any aggregate, even if the aggregate has members of a class type with user-defined type conversions. A copy/move assignment operator for class X is trivial if it is not user-provided and if: otherwise the copy/move assignment operator is non-trivial. The type wstreampos shall be an implementation-defined type that satisfies the requirements for pos_type in [iostreams.limits.pos, iostream.forward]. If the use of a template-argument gives rise to an ill-formed construct in the instantiation of a template specialization, the program is ill-formed. A template template-argument is dependent if it names a template-parameter or is a qualified-id that refers to a member of an unknown specialization. Members of an explicitly specialized class template are defined in the same manner as members of normal classes, and not using the template<> syntax. The result (value or exception) of a shared_future object can be set by calling a respective function on an object that shares the same shared state. The cv-qualified or cv-unqualified versions of a type are distinct types; however, they shall have the same representation and alignment requirements. If an invocation of a constructor uses the default value of an optional allocator argument, then the Allocator type must support value initialization. Mutating operations on unordered containers shall preserve the relative order of elements within each equivalent-key group unless otherwise specified. Except that any class member declared mutable can be modified, any attempt to modify a const object during its lifetime results in undefined behavior. A reference type that is declared using & is called an lvalue reference, and a reference type that is declared using && is called an rvalue reference. An explicitly-defaulted function that is not defined as deleted may be declared constexpr only if it would have been implicitly declared as constexpr. For an id-expression, name lookup begins in the class scope of this; for a qualified-id, name lookup begins in the scope of the nested-name-specifier. that is, the expression &(qualified-id), where the qualified-id is enclosed in parentheses, does not form an expression of type ``pointer to member''. If a new-expression calls a deallocation function, it passes the value returned from the allocation function call as the first argument of type void*. The implementation provides definitions for standard library entities, as necessary, while combining translation units to form a complete C++ program. A path that is not absolute, and as such, only unambiguously identifies the location of a file when resolved relative to an implied starting location. Evaluating a string-literal results in a string literal object with static storage duration, initialized from the given characters as specified above. If the alignment associated with a specific over-aligned type is not supported by an allocator, instantiation of the allocator for that type may fail. Like class template wstring_convert, it lets you specify a code conversion facet to perform the conversions, without affecting any streams or locales. An implied object argument must be contrived to correspond to the implicit object parameter attributed to member functions during overload resolution. If a class X only has a copy assignment operator with a parameter of type X&, an expression of type const X cannot be assigned to an object of type X. A specialization of a conversion function template is referenced in the same way as a non-template conversion function that converts to the same type. The class template future defines a type for asynchronous return objects which do not share their shared state with other asynchronous return objects. A friend function defined in a class is in the (lexical) scope of the class in which it is defined. A friend function defined outside the class is not. memory_order_seq_cst ensures sequential consistency only for a program that is free of data races and uses exclusively memory_order_seq_cst operations. The namespaces and classes associated with the argument types can include namespaces and classes already considered by the ordinary unqualified lookup. If std::exit is called to end a program during the destruction of an object with static or thread storage duration, the program has undefined behavior. The object representation of an object of type T is the sequence of N unsigned char objects taken up by the object of type T, where N equals sizeof(T). Scalar types, standard-layout class types, arrays of such types and cv-qualified versions of these types are collectively called standard-layout types. Whenever a class-key is followed by a class-head-name, the identifier final, and a colon or left brace, final is interpreted as a class-virt-specifier. A pointer to member shall not point to a static member of a class, a member with reference type, or ``cv void''. See also [expr.unary, expr.mptr.oper]. The distinguishing characteristic of logic errors is that they are due to errors in the internal logic of the program. In theory, they are preventable. Within the definition of a non-static member function, an identifier that names a non-static member is transformed to a class member access expression. The reaching scope of a local lambda expression is the set of enclosing scopes up to and including the innermost enclosing function and its parameters. Reordering of atomic loads in cases in which the atomics in question may alias is also generally precluded, since this may violate the coherence rules. The results of including in a translation unit shall be as if defined an instance of ios_base::Init with static storage duration. An iterator j is called reachable from an iterator i if and only if there is a finite sequence of applications of the expression ++i that makes i == j. With regular iterator classes, while (first != last) *result++ = *first++; causes a range [first, last) to be copied into a range starting with result. Each preprocessing token that is converted to a token shall have the lexical form of a keyword, an identifier, a literal, an operator, or a punctuator. An ntbs that contains characters only from the basic execution character set is also an ntmbs. Each multibyte character then consists of a single byte. A user specialization of allocator_traits may provide different defaults and may provide defaults for different requirements than the primary template. The specialization is specified in the standard, and not left as an implementation detail, because it affects the derivation interface for ctype. The type u16streampos shall be an implementation-defined type that satisfies the requirements for pos_type in [iostreams.limits.pos, iostream.forward]. The type u32streampos shall be an implementation-defined type that satisfies the requirements for pos_type in [iostreams.limits.pos, iostream.forward]. A function instantiated from a function template is called a function template specialization; so is an explicit specialization of a function template. If all of the template arguments can be deduced, they may all be omitted; in this case, the empty template argument list <> itself may also be omitted. Names of members are still visible, and implicit conversions to base classes are still considered, when those members and base classes are inaccessible. The sets of namespaces and classes are determined entirely by the types of the function arguments (and the namespace of any template template argument). A deallocation function may be an instance of a function template. Neither the first parameter nor the return type shall depend on a template parameter. A contiguous container is a container that supports random access iterators and whose member types iterator and const_iterator are contiguous iterators. For associative containers, no swap function throws an exception unless that exception is thrown by the swap of the container's Compare object (if any). A prvalue of an integer type or of an unscoped enumeration type can be converted to a prvalue of a floating point type. The result is exact if possible. A prvalue of type ``pointer to cv D'', where D is a class type, can be converted to a prvalue of type ``pointer to cv B'', where B is a base class of D. Ordinary unqualified lookup is not performed. In either case, e is an lvalue if the type of the entity e is an lvalue reference and an xvalue otherwise. A handler will be invoked only by throwing an exception in code executed in the handler's try block or in functions called from the handler's try block. If a declaration of a function has an implicit exception specification, other declarations of the function shall not specify an exception-specification. The keyword this names a pointer to the object for which a non-static member function is invoked or a non-static data member's initializer is evaluated. The operand of ~ shall have integral or unscoped enumeration type; the result is the ones' complement of its operand. Integral promotions are performed. sizeof(char), sizeof(signed char) and sizeof(unsigned char) are 1. The result of sizeof applied to any other fundamental type is implementation-defined. An implementation provides default definitions of the global deallocation functions operator delete() for non-arrays and operator delete[]() for arrays. The result of a .* expression whose second operand is a pointer to a data member is an lvalue if the first operand is an lvalue and an xvalue otherwise. A pointer past the last element of an array x of n elements is considered to be equivalent to a pointer to a hypothetical element x[n] for this purpose. A pointer past the last element of an array x of n elements is considered to be equivalent to a pointer to a hypothetical element x[n] for this purpose. An object is created by a definition, by a new-expression, when implicitly changing the active member of a union, or when a temporary object is created. When one thread creates another, the initial call to the top-level function of the new thread is executed by the new thread, not by the creating thread. A signal handler that is executed as a result of a call to the raise function belongs to the same thread of execution as the call to the raise function. The class template basic_iostream inherits a number of functions that allow reading input and writing output to sequences controlled by a stream buffer. Names which are defined as macros in C shall be defined as macros in the C++ standard library, even if C grants license for implementation as functions. When the parameter type is not a reference, the implicit conversion sequence models a copy-initialization of the parameter from the argument expression. An ellipsis conversion sequence occurs when an argument in a function call is matched with the ellipsis parameter specification of the function called . [over.ics.rank] defines a partial ordering of implicit conversion sequences based on the relationships better conversion sequence and better conversion. If conversion sequence S1 is neither better than nor worse than conversion sequence S2, S1 and S2 are said to be indistinguishable conversion sequences. If f() and g() are both overloaded functions, the cross product of possibilities must be considered to resolve f(&g), or the equivalent expression f(g). The contents and meaning of the header are the same as the C standard library header , except that it does not declare a type wchar_t. The class bad_cast defines the type of objects thrown as exceptions by the implementation to report the execution of an invalid dynamic-cast expression. A friend function template may be defined within a class or class template, but a friend class template may not be defined in a class or class template. A class template partial specialization may be declared or redeclared in any namespace scope in which the corresponding primary template may be defined. Trailing template arguments that can be deduced or obtained from default template-arguments may be omitted from the list of explicit template-arguments. An optional object for object types is an object that contains the storage for another object and manages the lifetime of this contained object, if any. In the places where one would expect to pass a pointer to a function to an algorithmic template, the interface is specified to accept a function object. Because access control applies to names, if access control is applied to a typedef name, only the accessibility of the typedef name itself is considered. If a pseudo-destructor-name contains a nested-name-specifier, the type-names are looked up as types in the scope designated by the nested-name-specifier. The implicit declarations do not introduce the names std, std::size_t, std::align_val_t, or any other names that the library uses to declare these names. Each member-declaration in the member-specification of an anonymous union shall either define a non-static data member or be a static_assert-declaration. The constexpr specifier shall be applied only to the definition of a variable or variable template or the declaration of a function or function template. Inherited members can be referred to in expressions in the same manner as other members of the derived class, unless their names are hidden or ambiguous. The header defines several types of predefined exceptions for reporting errors in a C++ program. These exceptions are related by inheritance. If a lambda-capture includes a capture-default that is =, each simple-capture of that lambda-capture shall be of the form ``& identifier'' or ``* this''. If the type is (possibly cv-qualified) void and the initializer is (), the expression is a prvalue of the specified type that performs no initialization. when the allocation function returns a value other than null, it must be a pointer to a block of storage in which space for the object has been reserved. Concurrent access to a stream object, stream buffer object, or C Library stream by multiple threads may result in a data race unless otherwise specified. If the iterator fails to read and store a value of T (fail() on the stream returns true), the iterator becomes equal to the end-of-stream iterator value. The containers, iterators, and algorithms libraries provide a C++ program with access to a subset of the most widely used algorithms and data structures. Any generic algorithm that uses the well-defined expression requirements is described in terms of the valid expressions for its template type parameters. It is unspecified whether a library component that has a swappable requirement includes the header to ensure an appropriate evaluation context. For every function type T that does not have cv-qualifiers or a ref-qualifier, there exist candidate operator functions of the form @T@& operator*(@T@*); A constructor declared without the function-specifier explicit specifies a conversion from the types of its parameters (if any) to the type of its class. The rules for conditions apply both to selection-statements and to the for and while statements. The declarator shall not specify a function or an array. If the name is re-declared in the outermost block of a substatement controlled by the condition, the declaration that re-declares the name is ill-formed. A copy operation associated with a return statement may be elided or converted to a move operation if an automatic storage duration variable is returned. Most classes specified in Clauses [string.classes, input.output] need a set of related types and functions to complete the definition of their semantics. The parameter parmN is the identifier of the rightmost parameter in the variable parameter list of the function definition (the one just before the ...). Each class template partial specialization is a distinct template and definitions shall be provided for the members of a template partial specialization. An explicit instantiation of a class, function template, or variable template specialization is placed in the namespace in which the template is defined. In addition to the exclusive lock ownership mode specified in [thread.mutex.requirements.mutex], shared mutex types provide a shared lock ownership mode. The ATOMIC_..._LOCK_FREE macros indicate the lock-free property of the corresponding atomic types, with the signed and unsigned variants grouped together. The macro can be used in the form: atomic_flag guard = ATOMIC_FLAG_INIT; It is unspecified whether the macro can be used in other initialization contexts. Given X::m (where X is a user-declared namespace), or given ::m (where X is the global namespace), if S(X, m) is the empty set, the program is ill-formed. A pointer to cv-qualified or cv-unqualified void can be used to point to objects of unknown type. Such a pointer shall be able to hold any object pointer. The names of the members of an anonymous union shall be distinct from the names of any other entity in the scope in which the anonymous union is declared. A prvalue of type ``pointer to noexcept function'' can be converted to a prvalue of type ``pointer to function''. The result is a pointer to the function. Each scoped enumerator is declared in the scope of the enumeration. These names obey the scope rules defined for all names in [basic.scope, basic.lookup]. If the optional initial inline keyword appears in a namespace-definition for a particular namespace, that namespace is declared to be an inline namespace. Function types are checked during the assignments and initializations of pointers to functions, references to functions, and pointers to member functions. If an exception is thrown during input then ios::badbit is turned on in *this's error state. If (exceptions()&badbit) != 0 then the exception is rethrown. An instance of basic_filebuf behaves as described in [filebuf] provided traits::pos_type is fpos. Otherwise the behavior is undefined. The class basic_ofstream supports writing to named files. It uses a basic_filebuf object to control the associated sequence. Template parameters named InputIterator shall meet the input iterator requirements and shall have a value type that is one of the encoded character types. The fundamental relation between a reverse iterator and its corresponding iterator i is established by the identity: &*(reverse_iterator(i)) == &*(i - 1). Extended characters may produce a long external identifier, but C++ does not place a translation limit on significant characters for external identifiers. After any necessary concatenation, in translation phase 7, '\ 0' is appended to every string literal so that programs that scan a string can find its end. Detailed specifications for each of the components in the library are in Clauses [language.support]--[thread], as shown in Table [tab:library.categories]. Libraries that store pointers outside the user's address space should make it appear that they are stored and retrieved from a traceable pointer location. For static member functions, the implicit object parameter is considered to match any object (since if the function is selected, the object is discarded). const and volatile semantics are not applied on an object under construction. They come into effect when the constructor for the most derived object ends. In an explicit destructor call, the destructor is specified by a ~ followed by a type-name or decltype-specifier that denotes the destructor's class type. The names of the template parameters are significant only for establishing the relationship between the template parameters and the rest of the signature. The injected-class-name of a class template or class template specialization can be used either as a template-name or a type-name wherever it is in scope. Inside a template, some constructs have semantics which may differ from one instantiation to another. Such a construct depends on the template parameters. When a template is instantiated, the names of its friends are treated as if the specialization had been explicitly declared at its point of instantiation. The exception-specification of a function template specialization is not instantiated along with the function declaration; it is instantiated when needed. A thread object does not represent a thread of execution after default construction, after being moved from, or after a successful call to detach or join. The lock and unlock operations on a single mutex shall appear to occur in a single total order. this can be viewed as the modification order of the mutex. The class template shared_future defines a type for asynchronous return objects which may share their shared state with other asynchronous return objects. There are no prvalue bit-fields; if a bit-field is converted to a prvalue, a prvalue of the type of the bit-field is created, which might then be promoted. A class is considered defined after the closing brace of its class-specifier has been seen even though its member functions are in general not yet defined. There is no requirement that the data be stored as a contiguous allocation of bool values. A space-optimized representation of bits is recommended instead. Any sequence container with random access iterator and supporting operations front(), push_back() and pop_back() can be used to instantiate priority_queue. An inline function or variable shall be defined in every translation unit in which it is odr-used and shall have exactly the same definition in every case. If a using-declaration uses the keyword typename and specifies a dependent name, the name introduced by the using-declaration is treated as a typedef-name. Linkage from C++ to objects defined in other languages and to objects defined in C++ from other languages is implementation-defined and language-dependent. Any type of the form ``cv-qualifier-seq array of N T'' is adjusted to ``array of N cv-qualifier-seq T'', and similarly for ``array of unknown bound of T''. Default arguments for a member function of a class template shall be specified on the initial declaration of the member function within the class template. If C has base classes, calculate the lookup set for f in each direct base class subobject B_i, and merge each such lookup set S(f,B_i) in turn into S(f,C). For each entity captured by copy, an unnamed non-static data member is declared in the closure type. The declaration order of these members is unspecified. The expression E1[E2] is identical (by definition) to *((E1)+(E2)) see [expr.unary, expr.add] for details of * and + and [dcl.array] for details of arrays. The effect of calling a function through a pointer to a function type that is not the same as the type used in the definition of the function is undefined. The contents and meaning of header are the same as the C standard library header , with the following changes: See also: ISO C~7.8. Table [tab:c.annex.k.names] lists the Annex K names that may be declared in some header. These names are also subject to the restrictions of [macro.names]. User-defined conversions are allowed for conversion of the initializer list elements to the constructor parameter types except as noted in [over.best.ics]. The value computations and side effects of destroying a temporary object are associated only with the full-expression, not with any specific subexpression. It is unspecified whether subobjects representing virtual base classes are assigned more than once by the implicitly-defined copy/move assignment operator. If the template-argument represents a set of overloaded functions (or a pointer or member pointer to such), the matching function is selected from the set. A template-id, that is, the template-name followed by a template-argument-list shall not be specified in the declaration of a primary template declaration. In an expression of the form x.y or xp->y the type of the expression is usually the type of the member y of the class of x (or the class pointed to by xp). The synthesized declarations are treated like any other functions in the remainder of overload resolution, except as explicitly noted in [over.match.best]. A function that takes an argument which specifies a timeout will throw if, during its execution, a clock, time point, or time duration throws an exception. The contained object may be initialized after the optional object has been initialized, and may be destroyed before the optional object has been destroyed. A class T can inherit from enable_shared_from_this to inherit the shared_from_this member functions that obtain a shared_ptr instance pointing to *this. In the descriptions of the functions that deal with ordering relationships we frequently use a notion of equivalence to describe concepts such as stability. Unsigned integers shall obey the laws of arithmetic modulo 2^n where n is the number of bits in the value representation of that particular size of integer. The discussion of each built-in operator in Clause [expr] indicates the category of the value it yields and the value categories of the operands it expects. Non-static data members of a (non-union) class with the same access control are allocated so that later members have higher addresses within a class object. The member shall still be defined in a namespace scope if it is odr-used in the program and the namespace scope definition shall not contain an initializer. For unordered_set and unordered_multiset the value type is the same as the key type. For unordered_map and unordered_multimap it is std::pair. A set is an associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of the keys themselves. Since signed, unsigned, long, and short by default imply int, a type-name appearing after one of those specifiers is treated as the name being (re)declared. The three components of a simple-declaration are the attributes, the specifiers (decl-specifier-seq; [dcl.spec]) and the declarators (init-declarator-list). If an exception is thrown during output, then ios::badbit is turned on in *this's error state. If (exceptions()&badbit) != 0 then the exception is rethrown. The class basic_ifstream supports reading from named files. It uses a basic_filebuf object to control the associated sequence. Unless otherwise specified, any ambiguity as to whether a given identifier has a special meaning is resolved to interpret the token as a regular identifier. The language support library provides components that are required by certain parts of the C++ language, such as memory allocation and exception processing. Certain types defined in Clause [input.output] are used to describe implementation-defined types. They are based on other types, but with added constraints. The implementation shall provide unique mappings for sequences consisting of one or more nondigits or digits followed by a period (.) and a single nondigit. If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined. If that user-written default constructor would satisfy the requirements of a constexpr constructor, the implicitly-defined default constructor is constexpr. The function template's function type and the specified type are used as the types of P and A, and the deduction is done as described in [temp.deduct.type]. The library provides templated helper functions to simplify applying move semantics to an lvalue and to simplify the implementation of forwarding functions. Constructing a type such that the number of bytes in its object representation exceeds the maximum value representable in the type std::size_t is ill-formed. Nested types are classes and enumerations declared in the class and arbitrary types declared as members by use of a typedef declaration or alias-declaration. The erase members shall invalidate only iterators and references to the erased elements, and preserve the relative order of the elements that are not erased. For a scoped enumeration type, the underlying type is int if it is not explicitly specified. In both of these cases, the underlying type is said to be fixed. If a program calls for the default-initialization of an object of a const-qualified type T, T shall be a class type with a user-provided default constructor. A function can have multiple declarations with different non-throwing exception-specifications; for this purpose, the one on the function definition is used. The parenthesized expression can be used in exactly the same contexts as those where E can be used, and with the same meaning, except as otherwise indicated. The delete-expression's result has type void. This implies that an object cannot be deleted using a pointer of type void* because void is not an object type. The && operator groups left-to-right. The operands are both contextually converted to bool. The result is true if both operands are true and false otherwise. Unlike |, || guarantees left-to-right evaluation; moreover, the second operand is not evaluated if the first operand evaluates to true. The result is a bool. Private members are not specified, but each implementation shall supply them to complete the definitions according to the description in the library Clauses. A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any well-formed program. Quoted manipulators are useful in ensuring that the content of a string with embedded spaces remains unchanged if inserted and then extracted via stream I/O. Some white space is required to separate otherwise adjacent identifiers, keywords, numeric literals, and alternative tokens containing alphabetic characters. On systems in which linkers cannot accept extended characters, an encoding of the universal-character-name may be used in forming valid external identifiers. The valarray component provides support for n-at-a-time processing, potentially implemented as parallel operations on platforms that support such processing. The library describes a standard set of requirements for allocators, which are class-type objects that encapsulate the information about an allocation model. For each type T from the C standard library, the types ::T and std::T are reserved to the implementation and, when defined, ::T shall be identical to std::T. After all parameters in the replacement list have been substituted and # and ## processing has taken place, all placemarker preprocessing tokens are removed. When a simple-template-id does not name a function, a default template-argument is implicitly instantiated when the value of that default argument is needed. For determining whether two dependent names are equivalent, only the name itself is considered, not the result of name lookup in the context of the template. The definition of a class or class template shall precede the declaration of an explicit specialization for a member template of the class or class template. The access to a member is affected by the class in which the member is named. This naming class is the class in which the member name was looked up and found. The implementation shall provide the functions and function template specializations identified as ``arithmetic operations on atomic types'' in [atomics.syn]. An entity is a value, object, reference, function, enumerator, type, class member, bit-field, template, template specialization, namespace, or parameter pack. The name of a scoped enumerator has enumeration scope. Its potential scope begins at its point of declaration and terminates at the end of the enum-specifier. array shall provide support for the special case N == 0. In the case that N == 0, begin() == end() == unique value. The return value of data() is unspecified. If the operand of a decltype-specifier is a prvalue, the temporary materialization conversion is not applied and no result object is provided for the prvalue. Since a using-declaration is a declaration, the restrictions on declarations of the same name in the same declarative region also apply to using-declarations. A using-directive specifies that the names in the nominated namespace can be used in the scope in which the using-directive appears after the using-directive. T is called the array element type; this type shall not be a reference type, the (possibly cv-qualified) type void, a function type or an abstract class type. A declarator-id or abstract-declarator containing an ellipsis shall only be used in a parameter-declaration. Such a parameter-declaration is a parameter pack. When initializing a multi-dimensional array, the initializer-clauses initialize the elements with the last (rightmost) index of the array varying the fastest. A handler is considered active when initialization is complete for the parameter (if any) of the catch clause. The stack will have been unwound at that point. The exception specification is either defined explicitly by using an exception-specification as a suffix of a function declaration's declarator or implicitly. The value of a postfix ++ expression is the value of its operand. the value obtained is a copy of the original value The operand shall be a modifiable lvalue. In a .* expression whose object expression is an rvalue, the program is ill-formed if the second operand is a pointer to member function with ref-qualifier &. The class strstream supports reading and writing from objects of class strstreambuf. It supplies a strstreambuf object to control the associated array object. An optional terminal or non-terminal symbol is indicated by the subscript ``_opt'', so { expression_opt } indicates an optional expression enclosed in braces. If an exception is thrown during output, then ios::badbit is turned on in *this's error state. If (exceptions() & badbit) != 0 then the exception is rethrown. Implementations should ensure that the resolution and range of file_time_type reflect the operating system dependent resolution and range of file time values. The class template istream_iterator is an input iterator that reads (using operator>>) successive elements from the input stream for which it was constructed. a class or a type used to represent a character It is used for one of the template parameters of the string, iostream, and regular expression class templates. If F's semantics contains a `Throws:', `Postconditions:', or `Complexity:' element, then that supersedes any occurrences of that element in the code sequence. Within Tables [tab:desc.var.def, tab:utilities.allocator.requirements], the use of move and forward always refers to std::move and std::forward, respectively. When comparing the call against a surrogate call function, the implied object argument is compared against the first parameter of the surrogate call function. The allocation and deallocation functions, operator new, operator new[], operator delete and operator delete, are described completely in [basic.stc.dynamic]. const and volatile semantics are not applied on an object under destruction. They stop being in effect when the destructor for the most derived object starts. A mem-initializer-list can delegate to another constructor of the constructor's class using any class-or-decltype that denotes the constructor's class itself. An alias template name is never deduced. However, if the template-id is dependent, subsequent template argument substitution still applies to the template-id. Friend declarations refer to functions or classes that are members of the nearest enclosing namespace, but they do not introduce new names into that namespace. A name declared in a block is local to that block; it has block scope. Its potential scope begins at its point of declaration and ends at the end of its block. If these conditions are not met, a pointer to the new object can be obtained from a pointer that represents the address of its storage by calling std::launder. Plain ints have the natural size suggested by the architecture of the execution environment; the other signed integer types are provided to meet special needs. An alignment is an implementation-defined integer value representing the number of bytes between successive addresses at which a given object can be allocated. For container adaptors, no swap function throws an exception unless that exception is thrown by the swap of the adaptor's Container or Compare object (if any). Redeclarations using different forms of the attribute (with or without the attribute-argument-clause or with different attribute-argument-clauses) are allowed. Whether the initialization of aggregates with static storage duration is static or dynamic is specified in [basic.start.static, basic.start.dynamic, stmt.dcl]. If no match is found among the handlers for a try block, the search for a matching handler continues in a dynamically surrounding try block of the same thread. An exception-specification can include the same type more than once and can include classes that are related by inheritance, even though doing so is redundant. The conversion function or conversion function template is public, constexpr, non-virtual, non-explicit, const, and has a non-throwing exception specification. In a .* expression whose object expression is an lvalue, the program is ill-formed if the second operand is a pointer to member function with ref-qualifier &&. If gnext is a null pointer, the seekable area is undefined. Otherwise, seeklow equals gbeg and seekhigh is either pend, if pend is not a null pointer, or gend. Clauses [lex] through [cpp] describe the C++ programming language. That description includes detailed syntactic specifications in a form described in [syntax]. White space can appear within a preprocessing token only as part of a header name or between the quotation characters in a character literal or string literal. A preprocessing number does not have a type or a value; it acquires both after a successful conversion to an integer literal token or a floating literal token. Whenever a name x defined in the standard library is mentioned, the name x is assumed to be fully qualified as ::std::x, unless explicitly described otherwise. Within any header that provides any non-defining declarations of constexpr functions or constructors an implementation shall provide corresponding definitions. Names in the expression-list or braced-init-list of a mem-initializer are evaluated in the scope of the constructor for which the mem-initializer is specified. A class object can be copied or moved in two ways: by initialization, including for function argument passing and for function value return; and by assignment. In a template-declaration, explicit specialization, or explicit instantiation the init-declarator-list in the declaration shall contain at most one declarator. For a template-argument that is a class type or a class template, the template definition has no special access rights to the members of the template-argument. A specialization of a member function template, member class template, or static data member template of a non-specialized class template is itself a template. Specializations of the standard library template std::numeric_limits shall specify the maximum and minimum values of each arithmetic type for an implementation. In the body of a non-static member function, the keyword this is a prvalue expression whose value is the address of the object for which the function is called. The member function size() returns the number of elements in the container. The number of elements is defined by the rules of constructors, inserts, and erases. Note that a pointer to member is not an object pointer or a function pointer and the rules for conversions of such pointers do not apply to pointers to members. Partial specializations of class templates are found by looking up the primary class template and then considering all partial specializations of that template. The exception-declaration shall not denote a pointer or reference to an incomplete type, other than void*, const void*, volatile void*, or const volatile void*. An implementation shall not reject an expression merely because when executed it throws or might throw an exception that the containing function does not allow. In an unevaluated operand, a non-static class member may be named and naming of objects or functions does not, by itself, require that a definition be provided. When a prvalue v of object pointer type is converted to the object pointer type ``pointer to cv T'', the result is static_cast(static_cast(v)). If the allocation function has a non-throwing exception specification, it returns null to indicate failure to allocate storage and a non-null pointer otherwise. If an operation A that modifies an atomic object M happens before an operation B that modifies M, then A shall be earlier than B in the modification order of M. trivial-clock is an implementation-defined type that satisfies the TrivialClock requirements and that is capable of representing and measuring file time values. The assignment operator=(const T& x) is defined on insert iterators to allow writing into them, it inserts x right before where the insert iterator is pointing. Operations on iterators obtained by calling a standard library container or string member function may access the underlying container, but shall not modify it. Because facets are used by iostreams, potentially while static constructors are running, their initialization cannot depend on programmed static initialization. Copying/moving one object into another using the copy/move constructor or the copy/move assignment operator does not change the layout or size of either object. The class nested_exception is designed for use as a mixin through multiple inheritance. It captures the currently handled exception and stores it for later use. There is an implementation-defined quantity that specifies the limit on the total depth of recursive instantiations, which could involve more than one template. Partial ordering of function templates containing template parameter packs is independent of the number of deduced arguments for those template parameter packs. If the template argument list of P contains a pack expansion that is not the last template argument, the entire template argument list is a non-deduced context. [thread.threads] describes components that can be used to create and manage threads. These threads are intended to map one-to-one with operating system threads. All placeholder types shall be DefaultConstructible and CopyConstructible, and their default constructors and copy/move constructors shall not throw exceptions. Each of the alias templates ratio_add, ratio_subtract, ratio_multiply, and ratio_divide denotes the result of an arithmetic computation on two ratios R1 and R2. A function first declared in a friend declaration has the linkage of the namespace of which it is a member. Otherwise, the function retains its previous linkage. Access is checked at the call point using the type of the expression used to denote the object for which the member function is called (B* in the example above). A deallocation function for a class is odr-used by a delete expression appearing in a potentially-evaluated expression as specified in [expr.delete, class.free]. An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. All other namespaces have external linkage. An implementation may have relaxed pointer safety, in which case the validity of a pointer value does not depend on whether it is a safely-derived pointer value. A vector is a sequence container that supports (amortized) constant time insert and erase operations at the end; insert and erase in the middle take linear time. As described in [dcl.init], the definition of an object or subobject of const-qualified type must specify an initializer or be subject to default-initialization. A class is said to be (directly or indirectly) derived from its (direct or indirect) base classes. See Clause [class.access] for the meaning of access-specifier. A class can be an indirect base class more than once and can be a direct and an indirect base class. There are limited things that can be done with such a class. The return type of an overriding function shall be either identical to the return type of the overridden function or covariant with the classes of the functions. Every constant-expression in a noptr-new-declarator shall be a converted constant expression of type std::size_t and shall evaluate to a strictly positive value. The implicit definition of a copy constructor as defaulted is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. The implicit definition of a copy assignment operator as defaulted is deprecated if the class has a user-declared copy constructor or a user-declared destructor. The header defines several functions that support extractors and inserters that alter information maintained by class ios_base and its derived classes. If an integer literal cannot be represented by any type in its list and an extended integer type can represent its value, it may have that extended integer type. Error conditions specify conditions where a function may fail. The conditions are listed, together with a suitable explanation, as the enum class errc constants. Clauses [language.support] through [thread] and Annex [depr] do not specify the representation of classes, and intentionally omit specification of class members. Standard conversion sequences are ordered by their ranks: an Exact Match is a better conversion than a Promotion, which is a better conversion than a Conversion. Two distinct function templates may have identical function return types and function parameter lists, even if overload resolution alone cannot distinguish them. The program is ill-formed, no diagnostic required, if: Otherwise, no diagnostic shall be issued for a template for which a valid specialization can be generated. The simple-template-id shall name a class template specialization. The template-name shall be the same identifier as the template-name of the simple-template-id. Ownership of the lockable object may be acquired at construction or after construction, and may be transferred, after acquisition, to another unique_lock object. Class condition_variable provides a condition variable that can only wait on an object of type unique_lock, allowing maximum efficiency on some platforms. In a derived class, the lookup of a base class name will find the injected-class-name instead of the name of the base class in the scope in which it was declared. The specific instances are defined in [atomics.types.generic, atomics.types.operations.general, atomics.types.operations.arith, atomics.types.operations.pointer]. For each argument type T in the function call, there is a set of zero or more associated namespaces and a set of zero or more associated classes to be considered. An elaborated-type-specifier may be used to refer to a previously declared class-name or enum-name even though the name has been hidden by a non-type declaration. The iterator returned by a.erase(q1,q2) points to the element pointed to by q2 prior to any elements being erased. If no such element exists, a.end() is returned. An incomplete type T may be used when instantiating list if the allocator satisfies the allocator completeness requirements [allocator.requirements.completeness]. There are some contexts where certain conversions are suppressed. For example, the lvalue-to-rvalue conversion is not done on the operand of the unary & operator. Except for functions with C++ linkage, a function declaration without a linkage specification shall not precede the first linkage specification for that function. In addition to declarations in which an incomplete object type is allowed, an array bound may be omitted in some cases in the declaration of a function parameter. A function definition of the form: attribute-specifier-seq_opt decl-specifier-seq_opt declarator virt-specifier-seq_opt = delete ; is called a deleted definition. The class length_error defines the type of objects thrown as exceptions to report an attempt to produce an object whose length exceeds its maximum allowable size. Unlike the object expression in other contexts, *this is not required to be of complete type for purposes of class member access outside the member function body. If the value of the operand of the delete-expression is a null pointer value, it is unspecified whether a deallocation function will be called as described above. program construct that an implementation is not required to support Each implementation documents all conditionally-supported constructs that it does not support. The value of an atomic object M, as determined by evaluation B, shall be the value stored by some side effect A that modifies M, where B does not happen before A. For a thread of execution providing weakly parallel forward progress guarantees, the implementation does not ensure that the thread will eventually make progress. If the hexadecimal value for a universal-character-name corresponds to a surrogate code point (in the range 0xD800--0xDFFF, inclusive), the program is ill-formed. The escape \ xhhh consists of the backslash followed by x followed by one or more hexadecimal digits that are taken to specify the value of the desired character. For a UTF-8 string literal, each successive element of the object representation has the value of the corresponding code unit of the UTF-8 encoding of the string. The syntactic non-terminal preceding the ud-suffix in a user-defined-literal is taken to be the longest sequence of characters that could match that non-terminal. an algorithm that preserves, as appropriate to the particular algorithm, the order of elements Requirements for stable algorithms are given in [algorithm.stable]. Complexity requirements specified in the library clauses are upper bounds, and implementations that provide better complexity guarantees satisfy the requirements. A type X satisfying any of the iterator requirements satisfies the requirements of ValueSwappable if, for any dereferenceable object x of type X, *x is swappable. Each member function of the form constexpr @return-type@ @F@(const charT* s, size_type pos, size_type n); is equivalent to return F(basic_string_view(s, n), pos); The type ptrdiff_t is an implementation-defined signed integer type that can hold the difference of two subscripts in an array object, as described in [expr.add]. The numeric_limits class template provides a C++ program with information about various properties of the implementation's representation of the arithmetic types. In a template-argument, an ambiguity between a type-id and an expression is resolved to a type-id, regardless of the form of the corresponding template-parameter. A template declaration in which the class template name is a simple-template-id is a partial specialization of the class template named in the simple-template-id. A program that necessitates the instantiation of template optional for a reference type, or for possibly cv-qualified types in_place_t or nullopt_t is ill-formed. The class type_index provides a simple wrapper for type_info which can be used as an index type in associative containers and in unordered associative containers. In any particular implementation, a plain char object can take on either the same values as a signed char or an unsigned char; which one is implementation-defined. A union object and its non-static data members are pointer-interconvertible. As a consequence, all non-static data members of a union object have the same address. A glvalue of a non-function, non-array type T can be converted to a prvalue. If T is an incomplete type, a program that necessitates this conversion is ill-formed. A prvalue of type bool can be converted to a prvalue of type int, with false becoming zero and true becoming one. These conversions are called integral promotions. If a keyword or an alternative token that satisfies the syntactic requirements of an identifier is contained in an attribute-token, it is considered an identifier. The ambiguity arising from the similarity between a function-style cast and a declaration mentioned in [stmt.ambig] can also occur in the context of a declaration. The unqualified-id get is looked up in the scope of E by class member access lookup, and if that finds at least one declaration, the initializer is e.get(). A function with an implied non-throwing exception specification, where the function's type is declared to be T, is instead considered to be of type ``noexcept T''. In some situations exception handling must be abandoned for less subtle error handling techniques. These situations are: In such cases, std::terminate() is called. F is a constexpr function if the corresponding specialization is a constexpr function. This will result in the implicit instantiation of the generic lambda's body. The use of a pseudo-destructor-name after a dot . or arrow -> operator represents the destructor for the non-class type denoted by type-name or decltype-specifier. The || operator groups left-to-right. The operands are both contextually converted to bool. It returns true if either of its operands is true, and false otherwise. With the qualifications noted in Clauses [language.support] through [thread] and in [diff.library], the C standard library is a subset of the C++ standard library. Given any two evaluations A and B, if A is sequenced before B (or, equivalently, B is sequenced after A), then the execution of A shall precede the execution of B. The enum class type perms is a bitmask type that specifies bitmask constants used to identify file permissions, with the meanings listed in Table [tab:enum.perms]. An integer literal is a sequence of digits that has no period or exponent part, with optional separating single quotes that are ignored when determining its value. The literal L is treated as a call of the form operator "" @X@(@str@, @len@) If L is a user-defined-character-literal, let ch be the literal without its ud-suffix. a class member function that accesses the state of an object of the class but does not alter that state Observer functions are specified as const member functions. The default constructor, copy constructor and copy assignment operator, move constructor and move assignment operator, and destructor are special member functions. A destructor that is defaulted and not defined as deleted is implicitly defined when it is odr-used or when it is explicitly defaulted after its first declaration. All destructors are called as if they were referenced with a qualified name, that is, ignoring any possible virtual overriding destructors in more derived classes. The names of the template parameters used in the definition of the member may be different from the template parameter names used in the class template definition. If a program contains declarations of function templates that are functionally equivalent but not equivalent, the program is ill-formed; no diagnostic is required. If the nth template parameter is a template parameter pack, the nth template argument is a pack expansion whose pattern is the name of the template parameter pack. If a function declaration acquired its function type through a dependent type without using the syntactic form of a function declarator, the program is ill-formed. Given a clock time point argument C_t, the clock time point of the return from timeout should be C_t + D_i + D_m when the clock is not adjusted during the timeout. The tick period is the amount of time which occurs from one tick to the next, in units of seconds. It is expressed as a rational constant using the template ratio. The names in a default argument are bound at the point of declaration, and access is checked at that point rather than at any points of use of the default argument. After the point of declaration of a class member, the member name can be looked up in the scope of its class. this is true even if the class is an incomplete class. A cv-qualified member function can be called on an object-expression only if the object-expression is as cv-qualified or less-cv-qualified than the member function. Lvalues of any Compare, Pred, or Hash types belonging to a and b shall be swappable and shall be exchanged by calling swap as described in [swappable.requirements]. An incomplete type T may be used when instantiating vector if the allocator satisfies the allocator completeness requirements [allocator.requirements.completeness]. Any sequence container supporting operations back(), push_back() and pop_back() can be used to instantiate stack. In particular, vector, list and deque can be used. The conversion truncates; that is, the fractional part is discarded. The behavior is undefined if the truncated value cannot be represented in the destination type. The identifier following the using keyword becomes a typedef-name and the optional attribute-specifier-seq following the identifier appertains to that typedef-name. In a given non-class scope, a typedef specifier can be used to redefine the name of any type declared in that scope to refer to the type to which it already refers. If the inline specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline. For a given inline function defined in different translation units, the accumulated sets of default arguments at the end of the translation units shall be the same. An expression of integral, enumeration, pointer, or pointer-to-member type can be explicitly converted to its own type; such a cast yields the value of its operand. For addition or subtraction, if the expressions P or Q have type ``pointer to cv T'', where T and the array element type are not similar, the behavior is undefined. The path does not necessarily exist in external storage, and the pathname is not necessarily valid for the current operating system or for a particular file system. To implement algorithms only in terms of iterators, it is often necessary to determine the value and difference types that correspond to a particular iterator type. Each universal-character-name in an identifier shall designate a character whose encoding in ISO 10646 falls into one of the ranges specified in [charname.allowed]. After translation phase 6, a string-literal that does not begin with an encoding-prefix is an ordinary string literal, and is initialized with the given characters. A null-terminated multibyte string, or ntmbs, is an ntbs that constitutes a sequence of valid multibyte characters, beginning and ending in the initial shift state. Within the standard library allocator_traits template, an optional requirement that is not supplied by an allocator is replaced by the specified default expression. A C++ header shown in its synopsis as including other C++ headers shall provide the declarations and definitions that appear in the synopses of those other headers. For every pointer to member type T or type std::nullptr_t there exist candidate operator functions of the form bool operator==(@T@, @T@); bool operator!=(@T@, @T@); A destructor can be declared virtual or pure virtual; if any objects of that class or any derived class are created in the program, the destructor shall be defined. A null statement is useful to carry a label just before the } of a compound statement and to supply a null body to an iteration statement such as a while statement. An explicit specialization of a member of a class template partial specialization is declared in the same way as an explicit specialization of the primary template. A lock is an object that holds a reference to a lockable object and may unlock the lockable object during the lock's destruction (such as when leaving block scope). The declarative region of the name of a template parameter of a template template-parameter is the smallest template-parameter-list in which the name was introduced. If the qualified-id has the form ::class-name-or-namespace-name::... the class-name-or-namespace-name is looked up in global scope as a class-name or namespace-name. The definition for a static data member that is not defined inline in the class definition shall appear in a namespace scope enclosing the member's class definition. The n-tuple of cv-qualifiers after the first one in the longest cv-decomposition of T, that is, cv_1, cv_2, ..., cv_n, is called the cv-qualification signature of T. Namespace-definitions are described in [namespace.def], using-declarations are described in [namespace.udecl] and using-directives are described in [namespace.udir]. In the declaration for an entity, attributes appertaining to that entity may appear at the start of the declaration and after the declarator-id for that declaration. The identifier in a namespace-alias-definition is a synonym for the name of the namespace denoted by the qualified-namespace-specifier and becomes a namespace-alias. It is possible to identify uniquely the location in the abstract-declarator where the identifier would appear if the construction were a declarator in a declaration. When a declaration of a function is introduced by way of a using-declaration, any default argument information associated with the declaration is made known as well. When a union is initialized with a brace-enclosed initializer, the braces shall only contain an initializer-clause for the first non-static data member of the union. When virtual base classes are used, a hidden declaration can be reached along a path through the subobject lattice that does not pass through the hiding declaration. If the type of the exception object would be an incomplete type or a pointer to an incomplete type other than (possibly cv-qualified) void the program is ill-formed. A postfix expression followed by a dot . or an arrow ->, optionally followed by the keyword template, and then followed by an id-expression, is a postfix expression. Entities created by a new-expression have dynamic storage duration. the lifetime of such an entity is not necessarily restricted to the scope in which it is created. The operators < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to) all yield false or true. The type of the result is bool. If two operands compare unequal, the result is false for the == operator and true for the != operator. Otherwise, the result of each of the operators is unspecified. The header defines four class templates and eight types that associate stream buffers with objects of class basic_string, as described in [string.classes]. The rule that appends a current directory (dot) element supports operating systems like OpenVMS that use different syntax for directory names and regular file names. A type of file with the property that when the file is encountered during pathname resolution, a string stored by the file is used to modify the pathname resolution. The directory_iterator default constructor shall create an iterator equal to the end iterator value, and this shall be the only valid iterator for the end condition. The behavior of a C++ program is undefined if it adds declarations or definitions to namespace std or to a namespace within namespace std unless otherwise specified. A declaration of a function template, class template, or variable template being explicitly specialized shall precede the declaration of the explicit specialization. If the qualified-id remove_reference_t::pointer is valid and denotes a type, then unique_ptr::pointer shall be a synonym for remove_reference_t::pointer. namespace std template class ratio public: static constexpr intmax_t num; static constexpr intmax_t den; using type = ratio; ; Terminating the program without leaving the current block (e.g., by calling the function std::exit(int)) does not destroy any objects with automatic storage duration. A class type (such as ``class X'') might be incomplete at one point in a translation unit and complete later on; the type ``class X'' is the same type at both points. Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largest extended character set specified among the supported locales. If the definition of a member function is lexically outside its class definition, the member function name shall be qualified by its class name using the :: operator. The iterator returned from a.erase(q) points to the element immediately following q prior to the element being erased. If no such element exists, a.end() is returned. Any sequence container supporting operations front(), back(), push_back() and pop_front() can be used to instantiate queue. In particular, list and deque can be used. The defining-type-specifier-seq of the defining-type-id shall not define a class or enumeration if the alias-declaration is the declaration of a template-declaration. Two consecutive left square bracket tokens shall appear only when introducing an attribute-specifier or within the balanced-token-seq of an attribute-argument-clause. If an error represents an out-of-memory condition, implementations are encouraged to throw an exception object of type bad_alloc [bad.alloc] rather than system_error. It is implementation-defined whether the lifetime of a parameter ends when the function in which it is defined returns or at the end of the enclosing full-expression. If an iterator of type directory_iterator reports an error or is advanced past the last directory element, that iterator shall become equal to the end iterator value. All output iterators support the expression *i = o where o is a value of some type that is in the set of types that are writable to the particular iterator type of i. A freestanding implementation has an implementation-defined set of headers. This set shall include at least the headers shown in Table [tab:cpp.headers.freestanding]. Each # preprocessing token in the replacement list for a function-like macro shall be followed by a parameter as the next preprocessing token in the replacement list. The special member functions affect the way objects of class type are created, copied, moved, and destroyed, and how values can be converted to values of other types. namespace std enum float_round_style round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, round_toward_infinity = 2, round_toward_neg_infinity = 3 ; The template argument list of a member of a class template partial specialization shall match the template argument list of the class template partial specialization. If only one of the function templates M is a non-static member of some class A, M is considered to have a new first parameter inserted in its function parameter list. The duration template uses the treat_as_floating_point trait to help determine if a duration object can be converted to another duration with a different tick period. The meaning of the friend declaration is the same whether the friend declaration appears in the private, protected or public portion of the class member-specification. Specializations and instantiations of the atomic template shall have a deleted copy constructor, a deleted copy assignment operator, and a constexpr value constructor. It is implementation-defined whether the dynamic initialization of a non-local inline variable with static storage duration happens before the first statement of main. For unordered associative containers, no swap function throws an exception unless that exception is thrown by the swap of the container's Hash or Pred object (if any). The name of a declared but undefined class can be used in an extern declaration. Such a declaration can only be used in ways that do not require a complete class type. For an enumeration whose underlying type is not fixed, the underlying type is an integral type that can represent all the enumerator values defined in the enumeration. A value of type std::nullptr_t can be converted to an integral type; the conversion has the same meaning and validity as a conversion of (void*)0 to the integral type. A synchronization operation without an associated memory location is a fence and can be either an acquire fence, a release fence, or both an acquire and release fence. namespace std template class fpos public: // [fpos.members], members: stateT state() const; void state(stateT); private; stateT st; // exposition-only ; If badbit is on in exceptions(), the output function rethrows the exception without completing its actions, otherwise it does not throw anything and treat as an error. Class template reverse_iterator is an iterator adaptor that iterates from the end of the sequence defined by its underlying iterator to the beginning of that sequence. Each global function signature declared with external linkage in a header is reserved to the implementation to designate that function signature with external linkage. Because of the rules for name lookup, the set of candidate functions consists (1) entirely of non-member functions or (2) entirely of member functions of some class T. If the user-defined conversion is specified by a specialization of a conversion function template, the second standard conversion sequence shall have exact match rank. Once a destructor is invoked for an object, the object no longer exists; the behavior is undefined if the destructor is invoked for an object whose lifetime has ended. If a mem-initializer-id is ambiguous because it designates both a direct non-virtual base class and an inherited virtual base class, the mem-initializer is ill-formed. A mem-initializer followed by an ellipsis is a pack expansion that initializes the base classes specified by a pack expansion in the base-specifier-list for the class. In the second form of if statement (the one including else), if the first substatement is also an if statement then that inner if statement shall contain an else part. A member function, member class or static data member of a class template can be explicitly instantiated from the member definition associated with its class template. The error_code reported by such an exception's code() member function shall compare equal to one of the conditions specified in the function's error condition element. The effect of calling any member function other than the destructor, the move-assignment operator, or valid on a future object for which valid() == false is undefined. A synchronized_pool_resource may be accessed from multiple threads without external synchronization and may have thread-specific pools to reduce synchronization costs. It is incumbent upon the definition of outer_allocator() to ensure that the recursion terminates. It will terminate for all instantiations of scoped_allocator_adaptor. A forwarding call wrapper is a call wrapper that can be called with an arbitrary argument list and delivers the arguments to the wrapped callable object as references. If the template argument D is zero or the absolute values of either of the template arguments N and D is not representable by type intmax_t, the program is ill-formed. Implementations must still guarantee that any given atomic access to a particular atomic object be indivisible with respect to all other atomic accesses to that object. atomic_intN_t, atomic_uintN_t, atomic_intptr_t, and atomic_uintptr_t shall be defined if and only if intN_t, uintN_t, intptr_t, and uintptr_t are defined, respectively. In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier only namespace names are considered. For unsigned narrow character types, each possible bit pattern of the value representation represents a distinct number. These requirements do not hold for other types. The default argument has the same semantic constraints as the initializer in a declaration of a variable of the parameter type, using the copy-initialization semantics. A static member, a nested type or an enumerator defined in a base class T can unambiguously be found even if an object has more than one base class subobject of type T. If during the evaluation of an expression, the result is not mathematically defined or not in the range of representable values for its type, the behavior is undefined. If *this is captured by copy, each odr-use of this is transformed into a pointer to the corresponding unnamed data member of the closure type, cast to the type of this. When a delete-expression is executed, the selected deallocation function shall be called with the address of the block of storage to be reclaimed as its first argument. behavior, for a well-formed program construct and correct data, that depends on the implementation The implementation is not required to document which behavior occurs. Mixing operations on corresponding wide- and narrow-character streams follows the same semantics as mixing such operations on FILEs, as specified in the ISO C standard. The placement of thousands-separator characters (if any) is determined by the value returned by grouping(), defined identically as the member numpunct<>::do_grouping(). The argument list submitted to overload resolution consists of the argument expressions present in the function call syntax preceded by the implied object argument (E). Any white-space characters preceding or following the replacement list of preprocessing tokens are not considered part of the replacement list for either form of macro. If the auto type-specifier appears in the decl-specifier-seq, the type of the identifier being declared is deduced from the initializer as described in [dcl.spec.auto]. In the do statement the substatement is executed repeatedly until the value of the expression becomes false. The test takes place after each execution of the statement. If a template-parameter of a primary class template, primary variable template, or alias template is a template parameter pack, it shall be the last template-parameter. In a type name that refers to a class template specialization, (e.g., A) the argument list shall match the template parameter list of the primary template. The template parameter list of a member of a class template partial specialization shall match the template parameter list of the class template partial specialization. If a waiting function can return before the state is made ready because of a timeout, then it is a timed waiting function, otherwise it is a non-timed waiting function. The names in a default template-argument have their access checked in the context in which they appear rather than at any points of use of the default template-argument. Two types cv1 T1 and cv2 T2 are layout-compatible types if T1 and T2 are the same type, layout-compatible enumerations, or layout-compatible standard-layout class types. For associative containers, if an exception is thrown by any operation from within an insert or emplace function inserting a single element, the insertion has no effect. The > token following the type-id in a dynamic_cast, static_cast, reinterpret_cast, or const_cast may be the product of replacing a >> token by two consecutive > tokens. Sequenced before is an asymmetric, transitive, pair-wise relation between evaluations executed by a single thread, which induces a partial order among those evaluations. The header defines two types and a function signature that control input from a stream buffer along with a function template that extracts from stream rvalues. For non-reserved replacement and handler functions, Clause [language.support] specifies two behaviors for the functions in question: their required and default behavior. The behavior of a C++ program is undefined if it adds declarations or definitions to namespace posix or to a namespace within namespace posix unless otherwise specified. Class template wbuffer_convert looks like a wide stream buffer, but performs all its I/O through an underlying byte stream buffer that you specify when you construct it. When comparing the call against the function call operators, the implied object argument is compared against the implicit object parameter of the function call operator. In all cases where a promoted integral type or promoted arithmetic type is required, an operand of enumeration type will be acceptable by way of the integral promotions. A mem-initializer where the mem-initializer-id denotes a virtual base class is ignored during execution of a constructor of any class that is not the most derived class. Every object of type basic_string shall use an object of type Allocator to allocate and free storage for the contained charT objects as needed. A template parameter of a deduction guide template that does not have a default argument shall be deducible from the parameter-type-list of the deduction guide template. A definition for a static data member or static data member template may be provided in a namespace scope enclosing the definition of the static member's class template. An asynchronous provider is an object that provides a result to a shared state. The result of a shared state is set by respective functions on the asynchronous provider. When an object of type optional is contextually converted to bool, the conversion returns true if the object contains a value; otherwise the conversion returns false. All the operations in [alg.sorting] have two versions: one that takes a function object of type Compare and one that uses an operator<. Compare is a function object type. Atomic read-modify-write operations shall always read the last value (in the modification order) written before the write associated with the read-modify-write operation. Operations that are lock-free should also be address-free. That is, atomic operations on the same memory location via two different addresses will communicate atomically. this is odr-used if it appears as a potentially-evaluated expression (including as the result of the implicit transformation in the body of a non-static member function). An allocation or deallocation function for a class is odr-used by a new-expression appearing in a potentially-evaluated expression as specified in [expr.new, class.free]. An implementation is not required to call allocation and deallocation functions from constructors or destructors; however, this is a permissible implementation technique. A parameter name shall not be redeclared in the outermost block of the function definition nor in the outermost block of any handler associated with a function-try-block. A char, a signed char, and an unsigned char occupy the same amount of storage and have the same alignment requirements; that is, they have the same object representation. A non-static member function may be called for an object of its class type, or for an object of a class derived from its class type, using the class member access syntax. Containers are objects that store other objects. They control allocation and deallocation of these objects through constructors, destructors, insert and erase operations. An incomplete type T may be used when instantiating forward_list if the allocator satisfies the allocator completeness requirements [allocator.requirements.completeness]. The class-key or enum keyword present in the elaborated-type-specifier shall agree in kind with the declaration to which the name in the elaborated-type-specifier refers. If a virtual function f in some class B is marked with the virt-specifier final and in a class D derived from B a function D::f overrides B::f, the program is ill-formed. The initialization of a parameter, including every associated value computation and side effect, is indeterminately sequenced with respect to that of any other parameter. When there is no parameter for a given argument, the argument is passed in such a way that the receiving function can obtain the value of the argument by invoking va_arg. If the object of type ``cv1 B'' is actually a subobject of an object of type D, the result refers to the enclosing object of type D. Otherwise, the behavior is undefined. Overload resolution is performed on a function call created by assembling an argument list. The first argument is the amount of space requested, and has type std::size_t. Errors arising from the operating system would typically be reported as system_category() errors with an error value of the error number reported by the operating system. The header defines several functions that support extractors and inserters that allow for the parsing and formatting of sequences and values for money and time. A character literal is one or more characters enclosed in single quotes, as in 'x', optionally preceded by u8, u, U, or L, as in u8'w', u'x', U'y', or L'z', respectively. The template definitions in the C++ standard library refer to various named requirements whose details are set out in tables [tab:equalitycomparable]--[tab:destructible]. Move operations may be explicitly specified or implicitly generated. Unless otherwise specified, such moved-from objects shall be placed in a valid but unspecified state. Valid category values include the locale member bitmask elements collate, ctype, monetary, numeric, time, and messages, each of which represents a single locale category. Each conversion in Table [tab:over.conversions] also has an associated rank (Exact Match, Promotion, or Conversion). These are used to rank standard conversion sequences. For every pair (T, VQ), where T is any type and VQ is either volatile or empty, there exist candidate operator functions of the form @T@*@VQ@& operator=(@T@*@VQ@&, @T@*); When an implementation introduces a temporary object of a class that has a non-trivial constructor, it shall ensure that a constructor is called for the temporary object. An abstract class is never a most derived class, thus its constructors never initialize virtual base classes, therefore the corresponding mem-initializers may be omitted. If, during parsing, a name in a template parameter is bound differently than it would be bound during a trial parse, the program is ill-formed. No diagnostic is required. The member functions of basic_string use an object of the Allocator class passed as a template parameter to allocate and free storage for the contained char-like objects. The header defines several functions that manage the allocation of dynamic storage in a program. It also defines components for reporting storage management errors. A variant object holds and manages the lifetime of a value. If the variant holds a value, that value's type has to be one of the template argument types given to variant. An assignment operator function in a class is odr-used by an implicitly-defined copy-assignment or move-assignment function for another class as specified in [class.copy]. It is implementation-defined whether the dynamic initialization of a non-local non-inline variable with static storage duration happens before the first statement of main. Arithmetic types, enumeration types, pointer types, pointer to member types, std::nullptr_t, and cv-qualified versions of these types are collectively called scalar types. Two types T1 and T2 are similar if they have cv-decompositions with the same n such that corresponding P_i components are the same and the types denoted by U are the same. The asm declaration is conditionally-supported; its meaning is implementation-defined. Typically it is used to pass information through the implementation to an assembler. If an exception is thrown during the destruction of temporaries or local variables for a return statement, the destructor for the returned object (if any) is also invoked. The exception-specification noexcept or noexcept(constant-expression), where the constant-expression yields true, denotes an exception specification that is the empty set. An implementation is not permitted to finish stack unwinding prematurely based on a determination that the unwind process will eventually cause a call to std::terminate(). By default, std::unexpected() calls std::terminate(), but a program can install its own handler function. In either case, the constraints in the following paragraph apply. If a lambda-expression captures an entity and that entity is not defined or captured in the immediately enclosing lambda expression or function, the program is ill-formed. The result of applying sizeof to a base class subobject is the size of the base class type. When applied to an array, the result is the total number of bytes in the array. The class strstreambuf associates the input sequence, and possibly the output sequence, with an object of some character array type, whose elements store arbitrary values. Concurrent forward progress guarantees are stronger than parallel forward progress guarantees, which in turn are stronger than weakly parallel forward progress guarantees. The objects are not destroyed during program execution.If it is possible for them to do so, implementations are encouraged to initialize the objects earlier than required. The class template basic_istream defines a number of member function signatures that assist in reading and interpreting input from sequences controlled by a stream buffer. The header defines a type and several function signatures that control output to a stream buffer along with a function template that inserts into stream rvalues. As described in Clause [cpp], in certain circumstances during translation phase 4, white space (or the absence thereof) serves as more than preprocessing token separation. For every type T, where T is a pointer, pointer-to-member, or scoped enumeration type, there exist candidate operator functions of the form @T@ operator?:(bool, @T@, @T@); A call to the setlocale function may introduce a data race with other calls to the setlocale function or with calls to functions that are affected by the current C locale. When the description of an algorithm gives an expression such as *first == value for a condition, the expression shall evaluate to either true or false in boolean contexts. When a block scope declaration of an entity with linkage is not found to refer to some other declaration, then that entity is a member of the innermost enclosing namespace. A virtual function call uses the default arguments in the declaration of the virtual function determined by the static type of the pointer or reference denoting the object. Within the initializer-list of a braced-init-list, the initializer-clauses, including any that result from pack expansions, are evaluated in the order in which they appear. The functions std::terminate() and std::unexpected() are used by the exception handling mechanism for coping with errors related to the exception handling mechanism itself. Whether or not the destructor is called for the std::type_info object at the end of the program is unspecified. The recommended name for such a class is extended_type_info. If a deallocation function with a parameter of type std::align_val_t is used, the alignment of the type of the object to be deleted is passed as the corresponding argument. Two accesses to the same object of type volatile sig_atomic_t do not result in a data race if both occur in the same thread, even if one or more occurs in a signal handler. The class basic_stringbuf is derived from basic_streambuf to associate possibly the input sequence and possibly the output sequence with a sequence of arbitrary characters. It is unspecified whether the implementation provides explicit definitions for such member function signatures, or for virtual destructors that can be generated by default. Virtual destructors have no effect on the deallocation function actually called when the cast-expression of a delete-expression refers to an array of objects of class type. A copy/move constructor that is defaulted and not defined as deleted is implicitly defined if it is odr-used or when it is explicitly defaulted after its first declaration. namespace std template<> struct char_traits; template<> struct char_traits; template<> struct char_traits; template<> struct char_traits; A setjmp/longjmp call pair has undefined behavior if replacing the setjmp and longjmp by catch and throw would invoke any non-trivial destructors for any automatic objects. If a specialization is not visible at the point of instantiation, and it would have been selected had it been visible, the program is ill-formed; no diagnostic is required. The template-arguments for a member function of a class template are determined by the template-arguments of the type of the object for which the member function is called. A specialization of a conversion function template is not found by name lookup. Instead, any conversion function templates visible in the context of the use are considered. When sizeof...(MutexTypes) is 1, the supplied Mutex type shall meet the BasicLockable requirements. Otherwise, each of the mutex types shall meet the Lockable requirements. Parallel algorithms access objects indirectly accessible via their arguments by invoking the following functions: These functions are herein called element access functions. A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name, if any, denotes the reference or object. When looking for a prior declaration of a class or function introduced by a friend declaration, scopes outside of the innermost enclosing namespace scope are not considered. Rehashing invalidates iterators, changes ordering between elements, and changes which buckets elements appear in, but does not invalidate pointers or references to elements. Modifying any list requires access to the element preceding the first element of interest, but in a forward_list there is no constant-time way to access a preceding element. If the auto type-specifier appears as one of the decl-specifiers in the decl-specifier-seq of a parameter-declaration of a lambda-expression, the lambda is a generic lambda. An alignment-specifier may be applied to a variable or to a class data member, but it shall not be applied to a bit-field, a function parameter, or an exception-declaration. The alignment requirement of an entity is the strictest non-zero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect. There is no access or ambiguity checking on this conversion; the access checking and disambiguation are done as part of the (possibly implicit) class member access operator. An object of type recursive_directory_iterator provides an iterator for a sequence of directory_entry elements representing the files in a directory and its sub-directories. The default constructor istreambuf_iterator() and the constructor istreambuf_iterator(0) both construct an end-of-stream iterator object suitable for use as an end-of-range. Then for the expressions w1 == w2 w1 != w2 either or both objects may be replaced by an equivalently-valued object of type X::const_void_pointer with no change in semantics. When the condition of a while statement is a declaration, the scope of the variable that is declared extends from its point of declaration to the end of the while statement. Constructors and member functions of pair shall not throw exceptions unless one of the element-wise operations specified to be called for that operation throws an exception. Constructed with different memory resources, different instances of the same specialization of pmr::polymorphic_allocator can exhibit entirely different allocation behavior. For templates greater, less, greater_equal, and less_equal, the specializations for any pointer type yield a total order, even if the built-in operators <, >, <=, >= do not. A name used in the definition of a static data member of class X (after the qualified-id of the static member) is looked up as if the name was used in a member function of X. If the elaborated-type-specifier is introduced by the enum keyword and this lookup does not find a previously declared type-name, the elaborated-type-specifier is ill-formed. A type cv void is an incomplete type that cannot be completed; such a type has an empty set of values. It is used as the return type for functions that do not return a value. The alignment requirement of a complete type can be queried using an alignof expression. Furthermore, the narrow character types shall have the weakest alignment requirement. A static member s of class X may be referred to using the qualified-id expression X::s; it is not necessary to use the class member access syntax to refer to a static member. In general, an implicit conversion sequence consists of a standard conversion sequence followed by a user-defined conversion followed by another standard conversion sequence. A simple-declaration or nodeclspec-function-declaration of the form attribute-specifier-seq_opt decl-specifier-seq_opt init-declarator-list_opt ; is divided into three parts. When thread_local is applied to a variable of block scope the storage-class-specifier static is implied if no other storage-class-specifier appears in the decl-specifier-seq. If an attempt is made to refer to an object defined with a volatile-qualified type through the use of a glvalue with a non-volatile-qualified type, the behavior is undefined. If a using-declaration names a class template, partial specializations introduced after the using-declaration are effectively visible because the primary template is visible. The attribute-token noreturn specifies that a function does not return. It shall appear at most once in each attribute-list and no attribute-argument-clause shall be present. The abstract class mechanism supports the notion of a general concept, such as a shape, of which only more concrete variants, such as circle and square, can actually be used. An exception can be thrown from one of the following contexts: throw-expressions, allocation functions, dynamic_cast, typeid, new-expressions, and standard library functions. A function is said to allow an exception of type E if its exception specification contains a type T for which a handler of type T would be a match for an exception of type E. [TeXComm "defncontext" [FixArg (TeXRaw "function")]] name, parameter type list, and enclosing namespace (if any) Signatures are used as a basis for name mangling and linking. Calls to the function tmpnam with an argument that is a null pointer value may introduce a data race with other calls to tmpnam with an argument that is a null pointer value. Certain nongraphic characters, the single quote ', the double quote ", the question mark ?, and the backslash \, can be represented according to Table [tab:escape.sequences]. For any locale loc either constructed, or returned by locale::classic(), and any facet Facet shown in Table [tab:localization.category.facets], has_facet(loc) is true. Operators not mentioned explicitly in subclauses [over.ass] through [over.inc] act as ordinary unary and binary operators obeying the rules of [over.unary] or [over.binary]. The value of a condition that is an initialized declaration in a statement other than a switch statement is the value of the declared variable contextually converted to bool. In the while statement the substatement is executed repeatedly until the value of the condition becomes false. The test takes place before each execution of the substatement. A top-level qualifier in a function parameter declaration does not affect the function type but still affects the type of the function parameter variable within the function. The mutex types are the standard library types std::mutex, std::recursive_mutex, std::timed_mutex, std::recursive_timed_mutex, std::shared_mutex, and std::shared_timed_mutex. The enumeration memory_order specifies the detailed regular (non-atomic) memory synchronization order as defined in [intro.multithread] and may provide for operation ordering. If two objects are pointer-interconvertible, then they have the same address, and it is possible to obtain a pointer to one from a pointer to the other via a reinterpret_cast. A declaration consisting solely of class-key identifier; is either a redeclaration of the name in the current scope or a forward declaration of the identifier as a class name. If a friend declaration in a non-local class first declares a class, function, class template or function template the friend is a member of the innermost enclosing namespace. The class error_code describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces. If a prvalue initially has the type ``cv T'', where T is a cv-unqualified non-class, non-array type, the type of the expression is adjusted to T prior to any further analysis. A synchronization operation on one or more memory locations is either a consume operation, an acquire operation, a release operation, or both an acquire and release operation. The class template basic_ostream defines a number of member function signatures that assist in formatting and writing output to output sequences controlled by a stream buffer. For every iterator of type Iterator, iterator_traits::iterator_category shall be defined to be the most specific category tag that describes the iterator's behavior. To make it possible to deal with insertion in the same way as writing into an array, a special kind of iterator adaptors, called insert iterators, are provided in the library. An integer literal may have a prefix that specifies its base and a suffix that specifies its type. The lexically first digit of the sequence of digits is the most significant. Unless otherwise specified, non-member functions in the standard library shall not use functions from another namespace which are found through argument-dependent name lookup. No actual type is established for the implicit object parameter of a static member function, and no attempt will be made to determine a conversion sequence for that parameter. The conversion performed for indirect binding to a reference to a possibly cv-qualified class type is determined in terms of a corresponding non-reference copy-initialization. A user-defined conversion sequence consists of an initial standard conversion sequence followed by a user-defined conversion followed by a second standard conversion sequence. If a non-static member function is selected, the reference to the overloaded function name is required to have the form of a pointer to member as described in [expr.unary.op]. For all members declared static constexpr in the numeric_limits template, specializations shall define these values in such a way that they are usable as constant expressions. If the type of a template-parameter contains a placeholder type, the deduced parameter type is determined from the type of the template-argument by placeholder type deduction. If the template arguments of a partial specialization cannot be deduced because of the structure of its template-parameter-list and the template-id, the program is ill-formed. Deduction guides are not found by name lookup. Instead, when performing class template argument deduction, any deduction guides declared for the class template are considered. A thread that owns a recursive_timed_mutex object may acquire additional levels of ownership by calling lock(), try_lock(), try_lock_for(), or try_lock_until() on that object. Condition variables provide synchronization primitives used to block a thread until notified by some other thread that some condition is met or until a system time is reached. The library also provides a matching function template to simplify their construction and several templates that provide access to pair objects as if they were tuple objects . If the type specifier in a friend declaration designates a (possibly cv-qualified) class type, that class is declared as a friend; otherwise, the friend declaration is ignored. During the execution of a parallel algorithm, if temporary memory resources are required for parallelization and none are available, the algorithm throws a bad_alloc exception. The atomic integral specializations and the specialization atomic shall have standard layout. They shall each have a trivial default constructor and a trivial destructor. The point of declaration for a class or class template first declared by a class-specifier is immediately after the identifier or simple-template-id (if any) in its class-head. The inline specifier indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function call mechanism. The next statement that would be executed after a fallthrough statement shall be a labeled statement whose label is a case label or default label for the same switch statement. The type denoted by a base-type-specifier shall be a class type that is not an incompletely defined class; this class is called a direct base class for the class being defined. Whenever an exception of type E is thrown and the search for a handler encounters the outermost block of a function with an exception specification that does not allow E, then, The result of a reference const_cast refers to the original object if the operand is a glvalue and to the result of applying the temporary materialization conversion otherwise. Each implementation shall include documentation that identifies all conditionally-supported constructs that it does not support and defines all locale-specific characteristics. (Equality does not guarantee the substitution property or referential transparency.) Algorithms on input iterators should never attempt to pass through the same iterator twice. Even when the creation of the temporary object is unevaluated, all the semantic restrictions shall be respected as if the temporary object had been created and later destroyed. The type max_align_t is a POD type whose alignment requirement is at least as great as that of every scalar type, and whose alignment requirement is supported in every context. A default template-argument shall not be specified in the template-parameter-lists of the definition of a member of a class template that appears outside of the member's class. If an expression e is type-dependent, decltype(e) denotes a unique dependent type. Two such decltype-specifiers refer to the same type only if their expressions are equivalent. If a virtual function is implicitly instantiated, its point of instantiation is immediately following the point of instantiation of its enclosing class template specialization. Any overhead in interrupt response, function return, and scheduling induces a ``quality of implementation'' delay, expressed as duration D_i. Ideally, this delay would be zero. The effect of calling any member function other than the destructor, the move-assignment operator, or valid() on a shared_future object for which valid() == false is undefined. namespace std template struct integer_sequence using value_type = T; static constexpr size_t size() noexcept return sizeof...(I); ; T shall be an integer type. The default memory resource pointer is a pointer to a memory resource that is used by certain facilities when an explicit memory resource is not supplied through the interface. If containers are nested to a depth greater than the number of allocators, the last allocator is used repeatedly, as in the single-allocator case, for any remaining recursions. Compare comp is used throughout for algorithms assuming an ordering relation. It is assumed that comp will not apply any non-constant function through the dereferenced iterator. The discussion of reference initialization in [dcl.init.ref] and of temporaries in [class.temporary] indicates the behavior of lvalues and rvalues in other significant contexts. A member-declarator of the form identifier_opt attribute-specifier-seq_opt : constant-expression specifies a bit-field; its length is set off from the bit-field name by a colon. During unqualified name lookup, the names appear as if they were declared in the nearest enclosing namespace which contains both the using-directive and the nominated namespace. A function definition of the form: attribute-specifier-seq_opt decl-specifier-seq_opt declarator virt-specifier-seq_opt = default ; is called an explicitly-defaulted definition. The scope resolution operator :: can be used to refer to a direct or indirect base member explicitly. This allows access to a name that has been redeclared in the derived class. When the handler declares a reference to an object, any changes to the referenced object are changes to the exception object and will have effect should that object be rethrown. The conversion function template has the same invented template-parameter-list, and the pointer to function has the same parameter types, as the function call operator template. One of the expressions shall be a glvalue of type ``array of T'' or a prvalue of type ``pointer to T'' and the other shall be a prvalue of unscoped enumeration or integral type. The dynamic_cast operator shall not cast away constness. If T is a pointer type, v shall be a prvalue of a pointer to complete class type, and the result is a prvalue of type T. In the case of an array, the elements will be destroyed in order of decreasing address (that is, in reverse order of the completion of their constructor; see [class.base.init]). A throw-expression with no operand rethrows the currently handled exception. The exception is reactivated with the existing exception object; no new exception object is created. An invocation of a standard library function that blocks is considered to continuously execute execution steps while waiting for the condition that it blocks on to be satisfied. The class template basic_fstream supports reading and writing from named files. It uses a basic_filebuf object to control the associated sequences. Escape sequences in which the character following the backslash is not listed in Table [tab:escape.sequences] are conditionally-supported, with implementation-defined semantics. If a best viable function exists and is unique, overload resolution succeeds and produces it as the result. Otherwise overload resolution fails and the invocation is ill-formed. Of interest in [over.call.func] are only those function calls in which the postfix-expression ultimately contains a name that denotes one or more functions that might be called. A #include preprocessing directive may appear in a source file that has been read because of a #include directive in another file, up to an implementation-defined nesting limit. If a class X only has a copy constructor with a parameter of type X&, an initializer of type const X or volatile X cannot initialize an object of type (possibly cv-qualified) X. A program is ill-formed if the copy/move constructor or the copy/move assignment operator for an object is implicitly odr-used and the special member function is not accessible. The point of declaration for an enumeration is immediately after the identifier (if any) in either its enum-specifier or its first opaque-enum-declaration, whichever comes first. Type names obey exactly the same scope rules as other names. In particular, type names defined within a class definition cannot be used outside their class without qualification. A prvalue of type ``pointer to cv T'', where T is an object type, can be converted to a prvalue of type ``pointer to cv void''. The pointer value is unchanged by this conversion. Redeclarations or specializations of a function or function template with a declared return type that uses a placeholder type shall also use that placeholder, not a deduced type. A declaration in a namespace N (excluding declarations in nested scopes) whose declarator-id is an unqualified-id declares (or redeclares) a member of N, and may be a definition. Since specializations of member templates for conversion functions are not found by name lookup, they are not considered when a using-declaration specifies a conversion function. Name lookup and checking of semantic constraints for default arguments in function templates and in member functions of class templates are performed as described in [temp.inst]. An array of unknown size initialized with a brace-enclosed initializer-list containing n initializer-clauses, where n shall be greater than zero, is defined as having n elements. Treatment of division by zero, forming a remainder using a zero divisor, and all floating point exceptions vary among machines, and is sometimes adjustable by a library function. If class B contains the original member, or is a base or derived class of the class containing the original member, the resulting pointer to member points to the original member. The operand of prefix -- is modified by subtracting 1. The requirements on the operand of prefix -- and the properties of its result are otherwise the same as those of prefix ++. Under the ``as-if'' rule an implementation is allowed to store two objects at the same machine address or not store an object at all if the program cannot observe the difference. For a valid iterator range [a, b) with dereferenceable a, the corresponding range denoted by pointers is [addressof(*a), addressof(*a) + (b - a)); b might not be dereferenceable. The string and iostream components use an explicit representation of operations required of template arguments. They use a class template char_traits to define these constraints. The individual arguments within the list are separated by comma preprocessing tokens, but comma preprocessing tokens between matching inner parentheses do not separate arguments. A macro definition lasts (independent of block structure) until a corresponding #undef directive is encountered or (if none is encountered) until the end of the translation unit. A default constructor for a class X is a constructor of class X that either has no parameters or else each parameter that is not a function parameter pack has a default argument. For an object with a non-trivial destructor, referring to any non-static member or base class of the object after the destructor finishes execution results in undefined behavior. The condition shall be of integral type, enumeration type, or class type. If of class type, the condition is contextually implicitly converted to an integral or enumeration type. The header defines a type associated with type information generated by the implementation. It also defines two types for reporting dynamic type identification errors. The template argument list of a primary template is a template argument list in which the nth template argument has the value of the nth template parameter of the class template. Some lockable objects are ``agent oblivious'' in that they work for any execution agent model because they do not determine or store the agent's ID (e.g., an ordinary spin lock). A function can be defined in a friend declaration of a class if and only if the class is a non-local class, the function name is unqualified, and the function has namespace scope. If S'(X, m) is not empty, S(X, m) is S'(X, m); otherwise, S(X, m) is the union of S(N_i, m) for all namespaces N_i nominated by using-directives in X and its inline namespace set. Valid alignments include only those values returned by an alignof expression for the fundamental types plus an additional implementation-defined set of values, which may be empty. A class declaration introduces the class name into the scope where it is declared and hides any class, variable, function, or other declaration of that name in an enclosing scope. None of the overloads of insert_after shall affect the validity of iterators and references, and erase_after shall invalidate only iterators and references to the erased elements. A map is an associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of values of another type T based on the keys. If a function with a declared return type that contains a placeholder type has multiple non-discarded return statements, the return type is deduced for each such return statement. Because a namespace-definition contains declarations in its namespace-body and a namespace-definition is itself a declaration, it follows that namespace-definitions can be nested. The name of the friend will be visible in its namespace if a matching declaration is provided at namespace scope (either before or after the class definition granting friendship). For the purpose of overload resolution, the functions that are introduced by a using-declaration into a derived class are treated as though they were members of the derived class. If two consecutive left square brackets appear where an attribute-specifier is not allowed, the program is ill-formed even if the brackets match an alternative grammar production. Every object of static storage duration is zero-initialized at program startup before any other initialization takes place. In some cases, additional initialization is done later. Referring to any non-static member or base class of an object in the handler for a function-try-block of a constructor or destructor for that object results in undefined behavior. If an exception-specification is specified in an explicit instantiation directive, it shall be compatible with the exception-specifications of other declarations of that function. An explicit type conversion can be expressed using functional notation, a type conversion operator (dynamic_cast, static_cast, reinterpret_cast, const_cast), or the cast notation. In both the source and execution basic character sets, the value of each character after 0 in the above list of decimal digits shall be one greater than the value of the previous. Preprocessing tokens can be separated by white space; this consists of comments, or white-space characters (space, horizontal tab, new-line, vertical tab, and form-feed), or both. Objects and functions defined in the library and required by a C++ program are included in the program prior to program startup. See also: replacement functions, run-time changes. Specializations on mbstate_t perform conversion between encodings known to the library implementer. Other encodings can be converted by specializing on a user-defined stateT type. In all contexts, when converting to the implicit object parameter or when converting to the left operand of an assignment operation only standard conversion sequences are allowed. If there are two or more conversions in the sequence, the conversions are applied in the canonical order: Lvalue Transformation, Promotion or Conversion, Qualification Adjustment. The string-literal or user-defined-string-literal in a literal-operator-id shall have no encoding-prefix and shall contain no characters other than the implicit terminating '\ 0'. For an object with a non-trivial constructor, referring to any non-static member or base class of the object before the constructor begins execution results in undefined behavior. During the instantation of an enclosing templated entity, if the condition is not value-dependent after its instantiation, the discarded substatement (if any) is not instantiated. The header shall define four specializations of the class template char_traits: char_traits, char_traits, char_traits, and char_traits. A friend of a class or class template can be a function template or class template, a specialization of a function template or class template, or a non-template function or class. If two different points of instantiation give a template specialization different meanings according to the one-definition rule, the program is ill-formed, no diagnostic required. A shared_future object with shared state can be created by conversion from a future object and shares its shared state with the original asynchronous provider of the shared state. An object of class any stores an instance of any type that satisfies the constructor requirements or it has no value, and this is referred to as the state of the class any object. The runtime pointer alignment function can be used to obtain an aligned pointer within a buffer; the aligned-storage templates in the library can be used to obtain aligned storage. A trivial class is a class that is trivially copyable and has one or more default constructors, all of which are either trivial or deleted and at least one of which is not deleted. A non-static member function may also be called directly using the function call syntax from within the body of a member function of its class or of a class derived from its class. If an attribute-specifier-seq that appertains to some entity or statement contains an attribute that is not allowed to apply to that entity or statement, the program is ill-formed. For an entity marked maybe_unused, implementations are encouraged not to emit a warning that the entity is unused, or that the entity is used despite the presence of the attribute. The effect of a cv-qualifier-seq in a function declarator is not the same as adding cv-qualification on top of the function type. In the latter case, the cv-qualifiers are ignored. The postfix expression before the dot or arrow is evaluated; the result of that evaluation, together with the id-expression, determines the result of the entire postfix expression. The simple call wrapper returned from a call to mem_fn(pm) shall have a nested type result_type that is a synonym for the return type of pm when pm is a pointer to member function. If a language construct is defined to produce an implicit call of a function, a use of the language construct is considered to be an expression for the purposes of this definition. The classes of Clause [input.output] with template arguments charT and traits behave as described if traits::pos_type and traits::off_type are streampos and streamoff respectively. The value of a char16_t literal containing a single c-char is equal to its ISO 10646 code point value, provided that the code point is representable with a single 16-bit code unit. The type wchar_t is able to represent all members of the execution wide-character set . The value of a wide-character literal containing multiple c-chars is implementation-defined. Unless otherwise specified, C++ standard library functions shall perform all operations solely within the current thread if those operations have effects that are visible to users. Objects constructed by the standard library that may hold a user-supplied pointer value or an integer of type std::intptr_t shall store such values in a traceable pointer location. An implicit conversion sequence is a sequence of conversions used to convert an argument in a function call to the type of the corresponding parameter of the function being called. If no conversions are required to match an argument to a parameter type, the implicit conversion sequence is the standard conversion sequence consisting of the identity conversion. On the other hand, if an f(B) were to be declared then f(b) would resolve to that f(B) because the exact match with f(B) is better than any of the sequences required to match f(A). If P is a cv-qualified type, the top-level cv-qualifiers of P's type are ignored for type deduction. If P is a reference type, the type referred to by P is used for type deduction. If A is a cv-qualified type, the top-level cv-qualifiers of A's type are ignored for type deduction. If A is a reference type, the type referred to by A is used for type deduction. Implementations can provide bitmasks to specify restrictions on task interaction by functions launched by async() applicable to a corresponding subset of available launch policies. Calls to functions that successfully set the stored result of a shared state synchronize with calls to functions successfully detecting the ready state resulting from that setting. For purposes of determining the presence of a data race, member functions shall access and modify only the shared_ptr and weak_ptr objects themselves and not objects they refer to. An unsynchronized_pool_resource class may not be accessed from multiple threads simultaneously and thus avoids the cost of synchronization entirely in single-threaded applications. The first sequence (the pattern to be searched for) is provided to the object's constructor, and the second (the sequence to be searched) is provided to the function call operator. There shall be pointer partial specializations of the atomic class template. These specializations shall have standard layout, trivial default constructors, and trivial destructors. Cv-qualifiers applied to an array type attach to the underlying element type, so the notation ``cv T'', where T is an array type, refers to an array whose elements are so-qualified. Every expression belongs to exactly one of the fundamental classifications in this taxonomy: lvalue, xvalue, or prvalue. This property of an expression is called its value category. An unscoped enumeration shall not be later redeclared as scoped and each redeclaration shall include an enum-base specifying the same underlying type as in the original declaration. An array can be constructed from one of the fundamental types (except void), from a pointer, from a pointer to member, from a class, from an enumeration type, or from another array. The corresponding specialization is that instantiation of the function call operator template with the same template arguments as those deduced for the conversion function template. , except that in the case of an array operand, the result is an lvalue if that operand is an lvalue and an xvalue otherwise. The expression E1 is sequenced before the expression E2. The sizeof operator shall not be applied to an expression that has function or incomplete type, to the parenthesized name of such types, or to a glvalue that designates a bit-field. If the expressions P and Q point to, respectively, elements x[i] and x[j] of the same array object x, the expression P - Q has the value i - j; otherwise, the behavior is undefined. An object with automatic or thread storage duration is associated with one specific thread, and can be accessed by a different thread only indirectly through a pointer or reference. No function described in Clause [input.output] except for ios_base::imbue and basic_filebuf::pubimbue causes any instance of basic_ios::imbue or basic_streambuf::imbue to be called. namespace std template > class basic_streambuf; using streambuf = basic_streambuf; using wstreambuf = basic_streambuf; a stream (described in Clause [input.output]) that can seek to any integral position within the length of the stream Every arbitrary-positional stream is also a repositional stream. Other properties, such as the lifetime, storage class, alignment, accessibility of the argument, whether the argument is a bit-field, and whether a function is deleted, are ignored. A partial specialization matches a given actual template argument list if the template arguments of the partial specialization can be deduced from the actual template argument list. A default template argument for a variable template is implicitly instantiated when the variable template is referenced in a context that requires the value of the default argument. Except for the destructor, member functions of the default allocator shall not introduce data races as a result of concurrent calls to those member functions from different threads. Every program shall contain exactly one definition of every non-inline function or variable that is odr-used in that program outside of a discarded statement; no diagnostic required. All variables declared with the thread_local keyword have thread storage duration. The storage for these entities shall last for the duration of the thread in which they are created. Whenever a glvalue appears in a context where a prvalue is expected, the glvalue is converted to a prvalue. An attempt to bind an rvalue reference to an lvalue is not such a context. The extent to which an implementation determines that a type cannot be an input iterator is unspecified, except that as a minimum integral types shall not qualify as input iterators. The number of buckets is automatically increased as elements are added to an unordered associative container, so that the average number of elements per bucket is kept below a bound. A multiset is an associative container that supports equivalent keys (possibly contains multiple copies of the same key value) and provides for fast retrieval of the keys themselves. An unordered_map satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). An unordered_set satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). A decomposition declaration introduces the identifiers of the identifier-list as names in the order of appearance, where v_i denotes the ith identifier, with numbering starting at 1. As specified above, brace elision cannot apply to subaggregates with no elements for purposes of aggregate initialization; an initializer-clause for the entire subobject is required. When the overriding function is called as the final overrider of the overridden function, its result is converted to the type returned by the (statically chosen) overridden function. The lambda return type is auto, which is replaced by the type specified by the trailing-return-type if provided and/or deduced from return statements as described in [dcl.spec.auto]. If a function or member function name is used, and name lookup does not find a declaration of that name, the program is ill-formed. No function is implicitly declared by such a call. Function parameter packs are expanded during template instantiation, thus each such argument has a corresponding parameter when a function template specialization is actually called. When typeid is applied to an expression other than a glvalue of a polymorphic class type, the result refers to a std::type_info object representing the static type of the expression. The class template specialization basic_ios serves as a virtual base class for the class templates basic_istream, basic_ostream, and class templates derived from them. The constructor with no arguments istream_iterator() always constructs an end-of-stream input iterator object, which is the only legitimate iterator to be used for the end condition. The suffixes f and F specify float, the suffixes l and L specify long double. If the scaled value is not in the range of representable values for its type, the program is ill-formed. The size of a char32_t or wide string literal is the total number of escape sequences, universal-character-names, and other characters, plus one for the terminating U'\ 0' or L'\ 0'. For conversion functions, the function is considered to be a member of the class of the implied object argument for the purpose of defining the type of the implicit object parameter. When the move constructor is not implicitly declared or explicitly supplied, expressions that otherwise would have invoked the move constructor may instead invoke a copy constructor. Under [temp.deduct.call, temp.deduct.partial], if P contains no template-parameters that appear in deduced contexts, no deduction is done, and so P and A need not have the same form. An object of type thread::id provides a unique identifier for each thread of execution and a single distinct value for all thread objects that do not represent a thread of execution. [futures] describes components that a C++ program can use to retrieve in one thread the result (value or exception) from a function that has run in the same thread or another thread. The non-member any_cast functions provide type-safe access to the contained object. Implementations should avoid the use of dynamically allocated memory for a small contained object. If treat_as_floating_point_v is true, then implicit conversions are allowed among durations. Otherwise, the implicit convertibility depends on the tick periods of the durations. The atomic_flag type shall have standard layout. It shall have a trivial default constructor, a deleted copy constructor, a deleted copy assignment operator, and a trivial destructor. If a character from this set is stored in a character object, the integral value of that character object is equal to the value of the single character literal form of that character. The set of values of the type float is a subset of the set of values of the type double; the set of values of the type double is a subset of the set of values of the type long double. When used in the declaration of a class member, the static specifier shall only be used in the member declarations that appear within the member-specification of the class definition. Unordered associative containers conform to the requirements for Containers, except that the expressions a == b and a != b have different semantics than for the other container types. It is intended that forward_list have zero space or time overhead relative to a hand-written C-style singly linked list. Features that would conflict with that goal have been omitted. The effect of any implicit conversion is the same as performing the corresponding declaration and initialization and then using the temporary variable as the result of the conversion. The base class members mentioned by a using-declaration shall be visible in the scope of at least one of the direct base classes of the class where the using-declaration is specified. The first declaration of a function shall specify the carries_dependency attribute for its declarator-id if any declaration of the function specifies the carries_dependency attribute. A non-static member shall not appear in a default argument unless it appears as the id-expression of a class member access expression or unless it is used to form a pointer to member. Declaring a function as defaulted after its first declaration can provide efficient execution and concise definition while enabling a stable binary interface to an evolving code base. An abstract class is a class that can be used only as a base class of some other class; no objects of an abstract class can be created except as subobjects of a class derived from it. In a binary fold, op1 and op2 shall be the same fold-operator, and either e1 shall contain an unexpanded parameter pack or e2 shall contain an unexpanded parameter pack, but not both. The == (equal to) and the != (not equal to) operators group left-to-right. The operands shall have arithmetic, enumeration, pointer, or pointer to member type, or type std::nullptr_t. For compatibility with prior C++ International Standards, a constexpr static data member may be redundantly redeclared outside the class with no initializer. This usage is deprecated. It is the implementation's responsibility to implement headers so that including and other headers does not violate the rules about multiple occurrences of default arguments. In Table [tab:iterator.input.requirements], the term the domain of == is used in the ordinary mathematical sense to denote the set of values over which == is (required to be) defined. A function may throw an object of a type not listed in its clause if its type is derived from a type named in the clause and would be caught by an exception handler for the base type. On exit from a scope (however accomplished), objects with automatic storage duration that have been constructed in that scope are destroyed in the reverse order of their construction. The class template basic_string_view describes an object that can refer to a constant contiguous sequence of char-like objects with the first element of the sequence at position zero. If the function selected by overload resolution can be determined without instantiating a class template definition, it is unspecified whether that instantiation actually takes place. If a function template or a member function template specialization is used in a way that involves overload resolution, a declaration of the specialization is implicitly instantiated. A trailing template-argument can be left unspecified in the template-id naming an explicit function template specialization provided it can be deduced from the function argument type. Template argument deduction is done by comparing certain types associated with the two function templates being compared. Two sets of types are used to determine the partial ordering. A future object with shared state can be created by functions on asynchronous providers or by the move constructor and shares its shared state with the original asynchronous provider. namespace std typedef enum memory_order memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst memory_order; Name lookup for a name used in the definition of a friend function defined inline in the class granting friendship shall proceed as described for lookup in member function definitions. If the id-expression in a class member access is an unqualified-id, and the type of the object expression is of a class type C, the unqualified-id is looked up in the scope of class C. When the end of the duration of a region of storage is reached, the values of all pointers representing the address of any part of that region of storage become invalid pointer values. The same representation and alignment requirements are meant to imply interchangeability as arguments to functions, return values from functions, and non-static data members of unions. The conversion of a null pointer constant to a pointer to cv-qualified type is a single conversion, and not the sequence of a pointer conversion followed by a qualification conversion. Because the language linkage is part of a function type, when indirecting through a pointer to C function, the function to which the resulting lvalue refers is considered a C function. Since () is not permitted by the syntax for initializer, X a(); is not the declaration of an object of class X, but the declaration of a function taking no argument and returning an X. The return type of the pointer to function shall behave as if it were a decltype-specifier denoting the return type of the corresponding function call operator template specialization. A function call is a postfix expression followed by parentheses containing a possibly empty, comma-separated list of initializer-clauses which constitute the arguments to the function. A null pointer constant of type std::nullptr_t cannot be converted to a pointer type, and a null pointer constant of integral type is not necessarily converted to a null pointer value. both new int and new int[10] have type int* and the type of new int[i][10] is int (*)[10] The attribute-specifier-seq in a noptr-new-declarator appertains to the associated array type. The result of a .* expression whose second operand is a pointer to a member function is a prvalue. If the second operand is the null pointer to member value, the behavior is undefined. Every value computation and side effect associated with the first expression is sequenced before every value computation and side effect associated with the second or third expression. [TeXComm "defncontext" [FixArg (TeXRaw "class member function")]] name, parameter type list, class of which the function is a member, cv-qualifiers (if any), and ref-qualifier (if any) Some objects are polymorphic; the implementation generates information associated with each such object that makes it possible to determine that object's type during program execution. Programs performing directory iteration may wish to test if the path obtained by dereferencing a directory iterator actually exists. It could be a symbolic link to a non-existent file. Calls to the function setlocale may introduce a data race with other calls to setlocale or with calls to the functions listed in Table [tab:setlocale.data.races]. See also: ISO C 7.11. If there is exactly one viable function that is a better function than all other viable functions, then it is the one selected by overload resolution; otherwise the call is ill-formed. The unary and binary forms of the same operator are considered to have the same name. Consequently, a unary operator can hide a binary operator from an enclosing scope, and vice versa. When in a group that is skipped, the directive syntax is relaxed to allow any sequence of preprocessing tokens to occur between the directive name and the following new-line character. If a # preprocessing token, followed by an identifier, occurs lexically at the point at which a preprocessing directive could begin, the identifier is not subject to macro replacement. The common subset of the C and C++ languages consists of all declarations, definitions, and expressions that may appear in a well formed C++ program and also in a conforming C program. When an optional object contains a value, val points to the contained value. T shall be an object type and shall satisfy the requirements of Destructible (Table [tab:destructible]). For purposes of determining the existence of data races, algorithms shall not modify objects referenced through an iterator argument unless the specification requires such modification. A heap is a particular organization of elements in a range between two random access iterators [a, b). Its two key properties are: These properties make heaps useful as priority queues. The ``volatile as device register'' semantics have not changed in the standard. This qualification means that volatility is preserved when applying these operations to volatile objects. A program that declares a variable main at global scope or that declares the name main with C language linkage (in any namespace) is ill-formed. The name main is not otherwise reserved. except that if the object is a union member or subobject thereof, its lifetime only begins if that union member is the initialized member in the union, or as described in [class.union]. Class objects can be assigned, passed as arguments to functions, and returned by functions (except objects of classes for which copying or moving has been restricted; see [class.copy]). The header defines the class templates unordered_map and unordered_multimap; the header defines the class templates unordered_set and unordered_multiset. The result of the conversion is a pointer to the base class subobject of the derived class object. The null pointer value is converted to the null pointer value of the destination type. A prvalue of type ``pointer to member of type noexcept function'' can be converted to a prvalue of type ``pointer to member of type function''. The result points to the member function. Within the scope of its declaration, a typedef-name is syntactically equivalent to a keyword and names the type associated with the identifier in the way described in Clause [dcl.decl]. If a typedef-name is used to identify the subject of an elaborated-type-specifier, a class definition, a constructor declaration, or a destructor declaration, the program is ill-formed. The enum-keys enum class and enum struct are semantically equivalent; an enumeration type declared with one of these is a scoped enumeration, and its enumerators are scoped enumerators. An enumeration whose underlying type is fixed is an incomplete type from its point of declaration to immediately after its enum-base (if any), at which point it becomes a complete type. Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a typedef-name or decltype-specifier, in which case the cv-qualifiers are ignored. although class B need not contain the original member, the dynamic type of the object with which indirection through the pointer to member is performed must contain the original member. A null pointer value is converted to the null pointer value of the destination type. The null member pointer value is converted to the null member pointer value of the destination type. If (os.flags() & ios_base::adjustfield) == ios_base::left is true, the fill characters are placed after the character sequence; otherwise, they are placed before the character sequence. Any library code that instantiates other library templates must be prepared to work adequately with any user-supplied specialization that meets the minimum requirements of the Standard. If no operand of an operator in an expression has a type that is a class or an enumeration, the operator is assumed to be a built-in operator and interpreted according to Clause [expr]. A function with type F is selected for the function type FT of the target type required in the context if F (after possibly applying the function pointer conversion) is identical to FT. The replaced sequence of preprocessing tokens is terminated by the matching ) preprocessing token, skipping intervening matched pairs of left and right parenthesis preprocessing tokens. A functional notation type conversion can be used to create new objects of its type. The syntax looks like an explicit call of the constructor. An object created in this way is unnamed. If an identifier introduced by a declaration was previously declared in an outer block, the outer declaration is hidden for the remainder of the block, after which it resumes its force. The type mbstate_t is defined in and can represent any of the conversion states that can occur in an implementation-defined set of supported multibyte character encoding rules. The type mbstate_t is defined in and can represent any of the conversion states that can occur in an implementation-defined set of supported multibyte character encoding rules. A simple-template-id that names a class template explicit specialization that has been declared but not defined can be used exactly like the names of other incompletely-defined classes. A name used in more than one translation unit can potentially refer to the same entity in these translation units depending on the linkage of the name specified in each translation unit. If class X is a local class a nested class Y may be declared in class X and later defined in the definition of class X or be later defined in the same scope as the definition of class X. It provides the operations described in the preceding requirements table for unique keys; that is, an unordered_map supports the a_uniq operations in that table, not the a_eq operations. It provides the operations described in the preceding requirements table for unique keys; that is, an unordered_set supports the a_uniq operations in that table, not the a_eq operations. In a given class scope, a typedef specifier can be used to redefine any class-name declared in that scope that is not also a typedef-name to refer to the type to which it already refers. The optional attribute-specifier-seq in a type-specifier-seq or a defining-type-specifier-seq appertains to the type denoted by the preceding type-specifiers or defining-type-specifiers. If the defining declaration of an entity has an alignment-specifier, any non-defining declaration of that entity shall either specify equivalent alignment or have no alignment-specifier. If a parameter name is present in a function declaration that is not a definition, it cannot be used outside of its function declarator because that is the extent of its potential scope. A deleted definition of a function shall be the first declaration of the function or, for an explicit specialization of a function template, the first declaration of that specialization. If E2 is a non-static data member or a non-static member function, the program is ill-formed if the class of which E2 is directly a member is an ambiguous base of the naming class of E2. The operand of the logical negation operator ! is contextually converted to bool; its value is true if the converted operand is false and false otherwise. The type of the result is bool. For a thread of execution providing concurrent forward progress guarantees, the implementation ensures that the thread will eventually make progress for as long as it has not terminated. (Exceptions thrown from basic_ios<>::clear() are not caught or rethrown.) If (exceptions()&badbit) != 0 then the exception is rethrown. It also counts the number of characters extracted. A const-qualified facet is a valid template argument to any locale function that expects a Facet template parameter. The refs argument to the constructor is used for lifetime management. A destructor is also invoked implicitly through use of a delete-expression for a constructed object allocated by a new-expression; the context of the invocation is the delete-expression. A return statement can involve an invocation of a constructor to perform a copy or move of the operand if it is not a prvalue or if its type differs from the return type of the function. The contents and meaning of the header are the same as the C standard library header , except that it does not declare types char16_t nor char32_t. See also: ISO C 7.28 When parsing a default template-argument for a non-type template-parameter, the first non-nested > is taken as the end of the template-parameter-list rather than a greater-than operator. The variety of list varies with the context: expression-list, base-specifier-list, template-argument-list, etc. When N is zero, the instantiation of the expansion produces an empty list. In the explicit specialization declaration for a function template or a member function template, the name of the function or member function explicitly specialized may be a template-id. A local class of a member function may access the same names that the member function itself may access. Access permissions are thus transitive and cumulative to nested and local classes. A C++ program shall provide at most one definition of a replaceable allocation or deallocation function. Any such function definition replaces the default version provided in the library. A class that has been declared but not defined, an enumeration type in certain contexts, or an array of unknown size or of incomplete element type, is an incompletely-defined object type. If the value true or false is stored into a bit-field of type bool of any size (including a one bit bit-field), the original bool value and the value of the bit-field shall compare equal. An unordered_multimap satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). An unordered_multiset satisfies all of the requirements of a container, of an unordered associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). A prvalue of type ``pointer to member of X of type cv1 T'' can be converted to a prvalue of type ``pointer to member of X of type cv2 T'' if ``cv2 T'' is more cv-qualified than ``cv1 T''. volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. An integral constant expression is an expression of integral or unscoped enumeration type, implicitly converted to a prvalue, where the converted expression is a core constant expression. The restrictions on reading and writing a sequence controlled by an object of class basic_filebuf are the same as for reading and writing with the C standard library FILEs. The value returned from F is specified by F's `Returns:' element, or if F has no `Returns:' element, a non-void return from F is specified by the `Returns:' elements in the code sequence. The entities in the C++ standard library are defined in headers, whose contents are made available to a translation unit when it contains the appropriate #include preprocessing directive. A qualified name used as the name in a mem-initializer-id, a base-specifier, or an elaborated-type-specifier is implicitly assumed to name a type, without the use of the typename keyword. An allocator cannot be a non-class type, however, even if allocator_traits supplies the entire required interface. Thus, it is always possible to create a derived class from an allocator. The invocations of element access functions in parallel algorithms invoked with an execution policy object of type execution::sequenced_policy all occur in the calling thread of execution. A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling std::exit with the return value as the argument. A map satisfies all of the requirements of a container, of a reversible container, of an associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). A set satisfies all of the requirements of a container, of a reversible container, of an associative container, and of an allocator-aware container (Table [tab:containers.allocatoraware]). The enclosing namespace set of O is the set of namespaces consisting of the innermost non-inline namespace enclosing an inline namespace O, together with any intervening inline namespaces. An aggregate array or an aggregate class may contain elements of a class type with a user-provided constructor. Initialization of these aggregate objects is described in [class.expl.init]. A base class subobject may be of zero size; however, two subobjects that have the same class type and that belong to the same most derived object must not be allocated at the same address. Where a parameter is of const reference type a temporary object is introduced if needed. In addition, it is possible to modify the values of nonconstant objects through pointer parameters. C++ is a general purpose programming language based on the C programming language as described in ISO/IEC 9899:1999 Programming languages --- C (hereinafter referred to as the C standard). Both groups of input functions are described as if they obtain (or extract) input characters by calling rdbuf()->sbumpc() or rdbuf()->sgetc(). They may use other public members of istream. Algorithms that take output iterators can be used with ostreams as the destination for placing data through the ostream_iterator class as well as with insert iterators and insert pointers. If X::propagate_on_container_move_assignment::value is true, X shall satisfy the MoveAssignable requirements (Table [tab:moveassignable]) and the move operation shall not throw exceptions. The locale facility includes internationalization support for character classification and string collation, numeric, monetary, and date/time formatting and parsing, and message retrieval. The algorithm for selecting the best viable function is linear in the number of viable functions. Run a simple tournament to find a function W that is not worse than any opponent it faced. An identifier __VA_ARGS__ that occurs in the replacement list shall be treated as if it were a parameter, and the variable arguments shall form the preprocessing tokens used to replace it. If the substatement in an iteration-statement is a single statement and not a compound-statement, it is as if it was rewritten to be a compound-statement containing the original statement. In every specialization basic_string_view, the type traits shall satisfy the character traits requirements, and the type traits::char_type shall name the same type as charT. It is unspecified whether or not an implementation implicitly instantiates a virtual member function of a class template if the virtual member function would not otherwise be instantiated. An object of an execution policy type indicates the kinds of parallelism allowed in the execution of an algorithm and expresses the consequent requirements on the element access functions. Cv-unqualified scalar types, trivially copyable class types, arrays of such types, and non-volatile const-qualified versions of these types are collectively called trivially copyable types. All implicit type conversions are considered when initializing the element with an assignment-expression. If the assignment-expression can initialize an element, the element is initialized. Throwing an exception copy-initializes a temporary object, called the exception object. An lvalue denoting the temporary is used to initialize the variable declared in the matching handler. The closure type associated with a lambda-expression has no default constructor and a deleted copy assignment operator. It has a defaulted copy constructor and a defaulted move constructor. The sizeof operator yields the number of bytes in the object representation of its operand. The operand is either an expression, which is an unevaluated operand, or a parenthesized type-id. an implementation shall provide default definitions for the global allocation functions. A C++ program can provide alternative definitions of these functions and/or class-specific versions. If a signal handler is executed as a result of a call to the raise function, then the execution of the handler is sequenced after the invocation of the raise function and before its return. The class failure defines the base class for the types of all objects thrown as exceptions, by functions in the iostreams library, to report errors detected during stream buffer operations. In translation phase 6, adjacent string-literals are concatenated. If both string-literals have the same encoding-prefix, the resulting concatenated string literal has that encoding-prefix. It is unspecified whether any function signature or class described in Clauses [language.support] through [thread] and Annex [depr] is a friend of another class in the C++ standard library. If the primary-expression E in the function call syntax evaluates to a class object of type ``cv T'', then the set of candidate functions includes at least the function call operators of T. For a class, its non-static data members, its non-virtual direct base classes, and, if the class is not abstract, its virtual base classes are called its potentially constructed subobjects. Because the mem-initializer are evaluated in the scope of the constructor, the this pointer can be used in the expression-list of a mem-initializer to refer to the object being initialized. If the if statement is of the form if constexpr, the value of the condition shall be a contextually converted constant expression of type bool; this form is called a constexpr if statement. If an entity is the subject of both an explicit instantiation declaration and an explicit instantiation definition in the same translation unit, the definition shall follow the declaration. In certain contexts, however, the value does not participate in type deduction, but instead uses the values of template arguments that were either deduced elsewhere or explicitly specified. A typical implementation would define aligned_storage as: template struct aligned_storage typedef struct alignas(Alignment) unsigned char __data[Len]; type; ;