List of Tables [tab]


5.5 Alternative tokens [lex.digraph]

Table 1 — Alternative tokens
Alternative
Primary
Alternative
Primary
Alternative
Primary
<%
{
and
&&
and_­eq
&=
%>
}
bitor
|
or_­eq
|=
<:
[
or
||
xor_­eq
^=
:>
]
xor
^
not
!
%:
#
compl
~
not_­eq
!=
%:%:
##
bitand
&

5.10 Identifiers [lex.name]

Table 2 — Ranges of characters allowed
00A8
00AA
00AD
00AF
00B2-00B5
00B7-00BA
00BC-00BE
00C0-00D6
00D8-00F6
00F8-00FF
0100-167F
1681-180D
180F-1FFF
200B-200D
202A-202E
203F-2040
2054
2060-206F
2070-218F
2460-24FF
2776-2793
2C00-2DFF
2E80-2FFF
3004-3007
3021-302F
3031-D7FF
F900-FD3D
FD40-FDCF
FDF0-FE44
FE47-FFFD
10000-1FFFD
20000-2FFFD
30000-3FFFD
40000-4FFFD
50000-5FFFD
60000-6FFFD
70000-7FFFD
80000-8FFFD
90000-9FFFD
A0000-AFFFD
B0000-BFFFD
C0000-CFFFD
D0000-DFFFD
E0000-EFFFD

5.10 Identifiers [lex.name]

Table 3 — Ranges of characters disallowed initially (combining characters)
0300-036F
1DC0-1DFF
20D0-20FF
FE20-FE2F

5.10 Identifiers [lex.name]

Table 4 — Identifiers with special meaning
override
final

5.11 Keywords [lex.key]

Table 5 — Keywords
alignas
continue
friend
register
true
alignof
decltype
goto
reinterpret_­cast
try
asm
default
if
return
typedef
auto
delete
inline
short
typeid
bool
do
int
signed
typename
break
double
long
sizeof
union
case
dynamic_­cast
mutable
static
unsigned
catch
else
namespace
static_­assert
using
char
enum
new
static_­cast
virtual
char16_­t
explicit
noexcept
struct
void
char32_­t
export
nullptr
switch
volatile
class
extern
operator
template
wchar_­t
const
false
private
this
while
constexpr
float
protected
thread_­local
const_­cast
for
public
throw

5.11 Keywords [lex.key]

Table 6 — Alternative representations
and
and_­eq
bitand
bitor
compl
not
not_­eq
or
or_­eq
xor
xor_­eq

5.13.2 Integer literals [lex.icon]

Table 7 — Types of integer literals
Suffix
Decimal literal
Binary, octal, or hexadecimal literal
none
int
int
long int
unsigned int
long long int
long int
unsigned long int
long long int
unsigned long long int
u or U
unsigned int
unsigned int
unsigned long int
unsigned long int
unsigned long long int
unsigned long long int
l or L
long int
long int
long long int
unsigned long int
long long int
unsigned long long int
Both u or U
unsigned long int
unsigned long int
and l or L
unsigned long long int
unsigned long long int
ll or LL
long long int
long long int
unsigned long long int
Both u or U
unsigned long long int
unsigned long long int
and ll or LL

5.13.3 Character literals [lex.ccon]

Table 8 — Escape sequences
new-line
NL(LF)
\n
horizontal tab
HT
\t
vertical tab
VT
\v
backspace
BS
\b
carriage return
CR
\r
form feed
FF
\f
alert
BEL
\a
backslash
\
\\
question mark
?
\?
single quote
'
\'
double quote
"
\"
octal number
ooo
\ooo
hex number
hhh
\xhhh

5.13.5 String literals [lex.string]

Table 9 — String literal concatenations
Source
Means
Source
Means
Source
Means
u"a"
u"b"
u"ab"
U"a"
U"b"
U"ab"
L"a"
L"b"
L"ab"
u"a"
"b"
u"ab"
U"a"
"b"
U"ab"
L"a"
"b"
L"ab"
"a"
u"b"
u"ab"
"a"
U"b"
U"ab"
"a"
L"b"
L"ab"

6.9.3 CV-qualifiers [basic.type.qualifier]

Table 10 — Relations on const and volatile
no cv-qualifier
<
const
no cv-qualifier
<
volatile
no cv-qualifier
<
const volatile
const
<
const volatile
volatile
<
const volatile

10.1.7.2 Simple type specifiers [dcl.type.simple]

Table 11simple-type-specifiers and the types they specify
Specifier(s)
Type
type-name
the type named
simple-template-id
the type as defined in [temp.names]
template-name
placeholder for a type to be deduced
char
“char”
unsigned char
“unsigned char”
signed char
“signed char”
char16_t
“char16_t”
char32_t
“char32_t”
bool
“bool”
unsigned
“unsigned int”
unsigned int
“unsigned int”
signed
“int”
signed int
“int”
int
“int”
unsigned short int
“unsigned short int”
unsigned short
“unsigned short int”
unsigned long int
“unsigned long int”
unsigned long
“unsigned long int”
unsigned long long int
“unsigned long long int”
unsigned long long
“unsigned long long int”
signed long int
“long int”
signed long
“long int”
signed long long int
“long long int”
signed long long
“long long int”
long long int
“long long int”
long long
“long long int”
long int
“long int”
long
“long int”
signed short int
“short int”
signed short
“short int”
short int
“short int”
short
“short int”
wchar_t
“wchar_t”
float
“float”
double
“double”
long double
“long double”
void
“void”
auto
placeholder for a type to be deduced
decltype(auto)
placeholder for a type to be deduced
decltype(expression)
the type as defined below

16.3.1.2 Operators in expressions [over.match.oper]

Table 12 — Relationship between operator and function call notation
Subclause
Expression
As member function
As non-member function
@a
(a).operator@ ()
operator@(a)
a@b
(a).operator@ (b)
operator@(a, b)
a=b
(a).operator= (b)
a[b]
(a).operator[](b)
a->
(a).operator->()
a@
(a).operator@ (0)
operator@(a, 0)

16.3.3.1.1 Standard conversion sequences [over.ics.scs]

Table 13 — Conversions
Conversion
Category
Rank
Subclause
No conversions required
Identity
Lvalue-to-rvalue conversion
Array-to-pointer conversion
Lvalue Transformation
Function-to-pointer conversion
Exact Match
Qualification conversions
Function pointer conversion
Qualification Adjustment
Integral promotions
Floating-point promotion
PromotionPromotion
Integral conversions
Floating-point conversions
Floating-integral conversions
Pointer conversions
ConversionConversion
Pointer to member conversions
Boolean conversions

17.5.3 Variadic templates [temp.variadic]

Table 14 — Value of folding empty sequences
Operator
Value when parameter pack is empty
&&
true
||
false
,
void()

20.1 General [library.general]

Table 15 — Library categories
Clause
Category
Language support library
Diagnostics library
General utilities library
Strings library
Localization library
Containers library
Iterators library
Algorithms library
Numerics library
Input/output library
Regular expressions library
Atomic operations library
Thread support library

20.5.1.2 Headers [headers]

Table 16 — C++ library headers
<algorithm>
<future>
<numeric>
<strstream>
<any>
<initializer_­list>
<optional>
<system_­error>
<array>
<iomanip>
<ostream>
<thread>
<atomic>
<ios>
<queue>
<tuple>
<bitset>
<iosfwd>
<random>
<type_­traits>
<chrono>
<iostream>
<ratio>
<typeindex>
<codecvt>
<istream>
<regex>
<typeinfo>
<complex>
<iterator>
<scoped_­allocator>
<unordered_­map>
<condition_­variable>
<limits>
<set>
<unordered_­set>
<deque>
<list>
<shared_­mutex>
<utility>
<exception>
<locale>
<sstream>
<valarray>
<execution>
<map>
<stack>
<variant>
<filesystem>
<memory>
<stdexcept>
<vector>
<forward_­list>
<memory_­resource>
<streambuf>
<fstream>
<mutex>
<string>
<functional>
<new>
<string_­view>

20.5.1.2 Headers [headers]

Table 17 — C++ headers for C library facilities
<cassert>
<cinttypes>
<csignal>
<cstdio>
<cwchar>
<ccomplex>
<ciso646>
<cstdalign>
<cstdlib>
<cwctype>
<cctype>
<climits>
<cstdarg>
<cstring>
<cerrno>
<clocale>
<cstdbool>
<ctgmath>
<cfenv>
<cmath>
<cstddef>
<ctime>
<cfloat>
<csetjmp>
<cstdint>
<cuchar>

20.5.1.2 Headers [headers]

Table 18 — C standard Annex K names
abort_­handler_­s
mbstowcs_­s
strncat_­s
vswscanf_­s
asctime_­s
memcpy_­s
strncpy_­s
vwprintf_­s
bsearch_­s
memmove_­s
strtok_­s
vwscanf_­s
constraint_­handler_­t
memset_­s
swprintf_­s
wcrtomb_­s
ctime_­s
printf_­s
swscanf_­s
wcscat_­s
errno_­t
qsort_­s
tmpfile_­s
wcscpy_­s
fopen_­s
RSIZE_­MAX
TMP_­MAX_­S
wcsncat_­s
fprintf_­s
rsize_­t
tmpnam_­s
wcsncpy_­s
freopen_­s
scanf_­s
vfprintf_­s
wcsnlen_­s
fscanf_­s
set_­constraint_­handler_­s
vfscanf_­s
wcsrtombs_­s
fwprintf_­s
snprintf_­s
vfwprintf_­s
wcstok_­s
fwscanf_­s
snwprintf_­s
vfwscanf_­s
wcstombs_­s
getenv_­s
sprintf_­s
vprintf_­s
wctomb_­s
gets_­s
sscanf_­s
vscanf_­s
wmemcpy_­s
gmtime_­s
strcat_­s
vsnprintf_­s
wmemmove_­s
ignore_­handler_­s
strcpy_­s
vsnwprintf_­s
wprintf_­s
L_­tmpnam_­s
strerror_­s
vsprintf_­s
wscanf_­s
localtime_­s
strerrorlen_­s
vsscanf_­s
mbsrtowcs_­s
strlen_­s
vswprintf_­s

20.5.1.3 Freestanding implementations [compliance]

Table 19 — C++ headers for freestanding implementations
Subclause
Header(s)
<ciso646>
Types
<cstddef>
Implementation properties
<cfloat> <limits> <climits>
Integer types
<cstdint>
Start and termination
<cstdlib>
Dynamic memory management
<new>
Type identification
<typeinfo>
Exception handling
<exception>
Initializer lists
<initializer_­list>
Other runtime support
<cstdarg>
Type traits
<type_­traits>
Atomics
<atomic>
Deprecated headers
<cstdalign> <cstdbool>

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 20EqualityComparable requirements
Expression
Return type
Requirement
a == b
convertible to bool
== is an equivalence relation, that is, it has the following properties:
  • For all a, a == a.
  • If a == b, then b == a.
  • If a == b and b == c, then a == c.

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 21LessThanComparable requirements
Expression
Return type
Requirement
a < b
convertible to bool
< is a strict weak ordering relation ([alg.sorting])

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 22DefaultConstructible requirements
Expression
Post-condition
T t;
object t is default-initialized
T u{};
object u is value-initialized or aggregate-initialized
T()
T{}
an object of type T is value-initialized or aggregate-initialized

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 23MoveConstructible requirements
Expression
Post-condition
T u = rv;
u is equivalent to the value of rv before the construction
T(rv)
T(rv) is equivalent to the value of rv before the construction
rv's state is unspecified
[Note
:
rv must still meet the requirements of the library component that is using it.
The operations listed in those requirements must work as specified whether rv has been moved from or not.
end note
]

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 24CopyConstructible requirements (in addition to MoveConstructible)
Expression
Post-condition
T u = v;
the value of v is unchanged and is equivalent to u
T(v)
the value of v is unchanged and is equivalent to T(v)

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 25MoveAssignable requirements
Expression
Return type
Return value
Post-condition
t = rv
T&
t
If t and rv do not refer to the same object, t is equivalent to the value of rv before the assignment
rv's state is unspecified.
[Note
:
 rv must still meet the requirements of the library component that is using it, whether or not t and rv refer to the same object.
The operations listed in those requirements must work as specified whether rv has been moved from or not.
end note
]

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 26CopyAssignable requirements (in addition to MoveAssignable)
Expression
Return type
Return value
Post-condition
t = v
T&
t
t is equivalent to v, the value of v is unchanged

20.5.3.1 Template argument requirements [utility.arg.requirements]

Table 27Destructible requirements
Expression
Post-condition
u.~T()
All resources owned by u are reclaimed, no exception is propagated.

20.5.3.3 NullablePointer requirements [nullablepointer.requirements]

Table 28NullablePointer requirements
Expression
Return type
Operational semantics
P u(np);
Postconditions: u == nullptr
P u = np;
P(np)
Postconditions: P(np) == nullptr
t = np
P&
Postconditions: t == nullptr
a != b
contextually convertible to bool
!(a == b)
a == np
contextually convertible to bool
a == P()
np == a
a != np
contextually convertible to bool
!(a == np)
np != a

20.5.3.4 Hash requirements [hash.requirements]

Table 29Hash requirements
Expression
Return type
Requirement
h(k)
size_­t
The value returned shall depend only on the argument k for the duration of the program.
[Note
:
Thus all evaluations of the expression h(k) with the same value for k yield the same result for a given execution of the program.
end note
]
[Note
:
For two different values t1 and t2, the probability that h(t1) and h(t2) compare equal should be very small, approaching 1.0 / numeric_­limits<size_­t>​::​max().
end note
]
h(u)
size_­t
Shall not modify u.

20.5.3.5 Allocator requirements [allocator.requirements]

Table 30 — Descriptive variable definitions
Variable
Definition
T, U, C
any cv-unqualified object type ([basic.types])
X
an Allocator class for type T
Y
the corresponding Allocator class for type U
XX
the type allocator_­traits<X>
YY
the type allocator_­traits<Y>
a, a1, a2
lvalues of type X
u
the name of a variable being declared
b
a value of type Y
c
a pointer of type C* through which indirection is valid
p
a value of type XX​::​pointer, obtained by calling a1.allocate, where a1 == a
q
a value of type XX​::​const_­pointer obtained by conversion from a value p.
w
a value of type XX​::​void_­pointer obtained by conversion from a value p
x
a value of type XX​::​const_­void_­pointer obtained by conversion from a value q or a value w
y
a value of type XX​::​const_­void_­pointer obtained by conversion from a result value of YY​::​allocate, or else a value of type (possibly const) std​::​nullptr_­t.
n
a value of type XX​::​size_­type.
Args
a template parameter pack
args
a function parameter pack with the pattern Args&&

20.5.3.5 Allocator requirements [allocator.requirements]

Table 31 — Allocator requirements
Expression
Return type
Assertion/note
Default
pre-/post-condition
X​::​pointer
T*
X​::​const_­pointer
X​::​pointer is convertible to X​::​const_­pointer
pointer_­traits<X​::​​pointer>​::​​rebind<const T>
X​::​void_­pointer
Y​::​void_­pointer
X​::​pointer is convertible to X​::​void_­pointer.
X​::​void_­pointer and Y​::​void_­pointer are the same type.
pointer_­traits<X​::​​pointer>​::​​rebind<void>
X​::​const_­void_­pointer
Y​::​const_­void_­pointer
X​::​pointer, X​::​const_­pointer, and X​::​void_­pointer are convertible to X​::​const_­void_­pointer.
X​::​const_­void_­pointer and Y​::​const_­void_­pointer are the same type.
pointer_­traits<X​::​​pointer>​::​​rebind<const void>
X​::​value_­type
Identical to T
X​::​size_­type
unsigned integer type
a type that can represent the size of the largest object in the allocation model.
make_­unsigned_­t<X​::​​difference_­type>
X​::​difference_­type
signed integer type
a type that can represent the difference between any two pointers in the allocation model.
pointer_­traits<X​::​​pointer>​::​​difference_­type
typename X​::​template rebind<U>​::​other
Y
For all U (including T), Y​::​template rebind<T>​::​other is X.
See Note A, below.
*p
T&
*q
const T&
*q refers to the same object as *p
p->m
type of T​::​m
Requires: (*p).m is well-defined.
equivalent to (*p).m
q->m
type of T​::​m
Requires: (*q).m is well-defined.
equivalent to (*q).m
static_­cast<​X​::​pointer​>(w)
X​::​pointer
static_­cast<X​::​pointer>(w) == p
static_­cast<​X​::​const_­pointer​>(x)
X​::​const_­pointer
static_­cast< X​::​const_­pointer​>(x) == q
pointer_­traits<​X​::​pointer​>​::​pointer_­to(r)
X​::​pointer
a.allocate(n)
X​::​pointer
Memory is allocated for n objects of type T but objects are not constructed.
allocate may throw an appropriate exception.175
[Note
:
If n == 0, the return value is unspecified.
end note
]
a.allocate(n, y)
X​::​pointer
Same as a.allocate(n).
The use of y is unspecified, but it is intended as an aid to locality.
a.allocate(n)
a.deallocate(p,n)
(not used)
Requires: p shall be a value returned by an earlier call to allocate that has not been invalidated by an intervening call to deallocate.
n shall match the value passed to allocate to obtain this memory.

Throws: Nothing.
a.max_­size()
X​::​size_­type
the largest value that can meaningfully be passed to X​::​allocate()
numeric_­limits<size_­type>​::​max() / sizeof​(value_­type)
a1 == a2
bool
returns true only if storage allocated from each can be deallocated via the other.
operator== shall be reflexive, symmetric, and transitive, and shall not exit via an exception.
a1 != a2
bool
same as !(a1 == a2)
a == b
bool
same as a == Y​::​rebind<T>​::​other(b)
a != b
bool
same as !(a == b)
X u(a);
X u = a;
Shall not exit via an exception.

Postconditions: u == a
X u(b);
Shall not exit via an exception.

Postconditions: Y(u) == b, u == X(b)
X u(std​::​move(a));
X u = std​::​move(a);
Shall not exit via an exception.

Postconditions: u is equal to the prior value of a.
X u(std​::​move(b));
Shall not exit via an exception.

Postconditions: u is equal to the prior value of X(b).
a.construct(c, args)
(not used)
Effects: Constructs an object of type C at c
​::​new ((void*)c) C(forward<​Args>​(args)...)
a.destroy(c)
(not used)
Effects: Destroys the object at c
c->~C()
a.select_­on_­container_­copy_­construction()
X
Typically returns either a or X()
return a;
X​::​propagate_­on_­container_­copy_­assignment
Identical to or derived from true_­type or false_­type
true_­type only if an allocator of type X should be copied when the client container is copy-assigned.
See Note B, below.
false_­type
X​::​propagate_­on_­container_­move_­assignment
Identical to or derived from true_­type or false_­type
true_­type only if an allocator of type X should be moved when the client container is move-assigned.
See Note B, below.
false_­type
X​::​propagate_­on_­- container_­swap
Identical to or derived from true_­type or false_­type
true_­type only if an allocator of type X should be swapped when the client container is swapped.
See Note B, below.
false_­type
X​::​is_­always_­equal
Identical to or derived from true_­type or false_­type
true_­type only if the expression a1 == a2 is guaranteed to be true for any two (possibly const) values a1, a2 of type X.
is_­empty<X>​::​​type

21.1 General [support.general]

Table 32 — Language support library summary
Subclause
Header(s)
Common definitions
<cstddef>
<cstdlib>
Implementation properties
<limits>
<climits>
<cfloat>
Integer types
<cstdint>
Start and termination
<cstdlib>
Dynamic memory management
<new>
Type identification
<typeinfo>
Exception handling
<exception>
Initializer lists
<initializer_­list>
Other runtime support
<csignal>
<csetjmp>
<cstdarg>
<cstdlib>

22.1 General [diagnostics.general]

Table 33 — Diagnostics library summary
Subclause
Header(s)
Exception classes
<stdexcept>
Assertions
<cassert>
Error numbers
<cerrno>
System error support
<system_­error>

23.1 General [utilities.general]

Table 34 — General utilities library summary
Subclause
Header(s)
Utility components
<utility>
Compile-time integer sequences
<utility>
Pairs
<utility>
Tuples
<tuple>
Optional objects
<optional>
Variants
<variant>
Storage for any type
<any>
Fixed-size sequences of bits
<bitset>
Memory
<memory>
<cstdlib>
Smart pointers
<memory>
Memory resources
<memory_­resource>
Scoped allocators
<scoped_­allocator>
Function objects
<functional>
Type traits
<type_­traits>
Compile-time rational arithmetic
<ratio>
Time utilities
<chrono>
<ctime>
Type indexes
<typeindex>
Execution policies
<execution>

23.15.4.1 Primary type categories [meta.unary.cat]

Table 35 — Primary type category predicates
Template
Condition
Comments
template <class T>
struct is_­void;
T is void
template <class T>
struct is_­null_­pointer;
T is nullptr_­t ([basic.fundamental])
template <class T>
struct is_­integral;
T is an integral type ([basic.fundamental])
template <class T>
struct is_­floating_­point;
T is a floating-point type ([basic.fundamental])
template <class T>
struct is_­array;
T is an array type ([basic.compound]) of known or unknown extent
Class template array ([array]) is not an array type.
template <class T>
struct is_­pointer;
T is a pointer type ([basic.compound])
Includes pointers to functions but not pointers to non-static members.
template <class T>
struct is_­lvalue_­reference;
T is an lvalue reference type ([dcl.ref])
template <class T>
struct is_­rvalue_­reference;
T is an rvalue reference type ([dcl.ref])
template <class T>
struct is_­member_­object_­pointer;
T is a pointer to non-static data member
template <class T>
struct is_­member_­function_­pointer;
T is a pointer to non-static member function
template <class T>
struct is_­enum;
T is an enumeration type ([basic.compound])
template <class T>
struct is_­union;
T is a union type ([basic.compound])
template <class T>
struct is_­class;
T is a non-union class type ([basic.compound])
template <class T>
struct is_­function;
T is a function type ([basic.compound])

23.15.4.2 Composite type traits [meta.unary.comp]

Table 36 — Composite type category predicates
Template
Condition
Comments
template <class T>
struct is_­reference;
T is an lvalue reference or an rvalue reference
template <class T>
struct is_­arithmetic;
T is an arithmetic type ([basic.fundamental])
template <class T>
struct is_­fundamental;
T is a fundamental type ([basic.fundamental])
template <class T>
struct is_­object;
T is an object type ([basic.types])
template <class T>
struct is_­scalar;
T is a scalar type ([basic.types])
template <class T>
struct is_­compound;
T is a compound type ([basic.compound])
template <class T>
struct is_­member_­pointer;
T is a pointer to non-static data member or non-static member function

23.15.4.3 Type properties [meta.unary.prop]

Table 37 — Type property predicates
Template
Condition
Preconditions
template <class T>
struct is_­const;
T is const-qualified ([basic.type.qualifier])
template <class T>
struct is_­volatile;
T is volatile-qualified ([basic.type.qualifier])
template <class T>
struct is_­trivial;
T is a trivial type ([basic.types])
remove_­all_­extents_­t<T> shall be a complete type or cv void.
template <class T>
struct is_­trivially_­copyable;
T is a trivially copyable type ([basic.types])
remove_­all_­extents_­t<T> shall be a complete type or cv void.
template <class T>
struct is_­standard_­layout;
T is a standard-layout type ([basic.types])
remove_­all_­extents_­t<T> shall be a complete type or cv void.
template <class T>
struct is_­pod;
T is a POD type ([basic.types])
remove_­all_­extents_­t<T> shall be a complete type or cv void.
template <class T>
struct is_­empty;
T is a class type, but not a union type, with no non-static data members other than bit-fields of length 0, no virtual member functions, no virtual base classes, and no base class B for which is_­empty_­v<B> is false.
If T is a non-union class type, T shall be a complete type.
template <class T>
struct is_­polymorphic;
T is a polymorphic class ([class.virtual])
If T is a non-union class type, T shall be a complete type.
template <class T>
struct is_­abstract;
T is an abstract class ([class.abstract])
If T is a non-union class type, T shall be a complete type.
template <class T>
struct is_­final;
T is a class type marked with the class-virt-specifier final (Clause [class]).
[Note
:
A union is a class type that can be marked with final.
end note
]
If T is a class type, T shall be a complete type.
template <class T>
struct is_­aggregate;
T is an aggregate type ([dcl.init.aggr])
remove_­all_­extents_­t<T> shall be a complete type or cv void.
template <class T>
struct is_­signed;
If is_­arithmetic_­v<T> is true, the same result as T(-1) < T(0); otherwise, false
template <class T>
struct is_­unsigned;
If is_­arithmetic_­v<T> is true, the same result as T(0) < T(-1); otherwise, false
template <class T, class... Args>
struct is_­constructible;
For a function type T or for a cv void type T, is_­constructible_­v<T, Args...> is false, otherwise see below
T and all types in the parameter pack Args shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­default_­constructible;
is_­constructible_­v<T> is true.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­copy_­constructible;
For a referenceable type T ([defns.referenceable]), the same result as is_­constructible_­v<T, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­move_­constructible;
For a referenceable type T, the same result as is_­constructible_­v<T, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class U>
struct is_­assignable;
The expression declval<T>() = declval<U>() is well-formed when treated as an unevaluated operand (Clause [expr]).
Access checking is performed as if in a context unrelated to T and U.
Only the validity of the immediate context of the assignment expression is considered.
[Note
:
The compilation of the expression can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on.
Such side effects are not in the “immediate context” and can result in the program being ill-formed.
end note
]
T and U shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­copy_­assignable;
For a referenceable type T, the same result as is_­assignable_­v<T&, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­move_­assignable;
For a referenceable type T, the same result as is_­assignable_­v<T&, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class U>
struct is_­swappable_­with;
The expressions swap(declval<T>(), declval<U>()) and swap(declval<U>(), declval<T>()) are each well-formed when treated as an unevaluated operand (Clause [expr]) in an overload-resolution context for swappable values ([swappable.requirements]).
Access checking is performed as if in a context unrelated to T and U.
Only the validity of the immediate context of the swap expressions is considered.
[Note
:
The compilation of the expressions can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on.
Such side effects are not in the “immediate context” and can result in the program being ill-formed.
end note
]
T and U shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­swappable;
For a referenceable type T, the same result as is_­swappable_­with_­v<T&, T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­destructible;
Either T is a reference type, or T is a complete object type for which the expression declval<U&>().~U() is well-formed when treated as an unevaluated operand (Clause [expr]), where U is remove_­all_­extents<T>.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class... Args>
struct
is_­trivially_­constructible;
is_­constructible_­v<T,
Args...> is true and the variable definition for is_­constructible, as defined below, is known to call no operation that is not trivial ([basic.types], [special]).
T and all types in the parameter pack Args shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­trivially_­default_­constructible;
is_­trivially_­constructible_­v<T> is true.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­trivially_­copy_­constructible;
For a referenceable type T, the same result as is_­trivially_­constructible_­v<T, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­trivially_­move_­constructible;
For a referenceable type T, the same result as is_­trivially_­constructible_­v<T, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class U>
struct is_­trivially_­assignable;
is_­assignable_­v<T, U> is true and the assignment, as defined by is_­assignable, is known to call no operation that is not trivial ([basic.types], [special]).
T and U shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­trivially_­copy_­assignable;
For a referenceable type T, the same result as is_­trivially_­assignable_­v<T&, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­trivially_­move_­assignable;
For a referenceable type T, the same result as is_­trivially_­assignable_­v<T&, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­trivially_­destructible;
is_­destructible_­v<T> is true and the indicated destructor is known to be trivial.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class... Args>
struct is_­nothrow_­constructible;
is_­constructible_­v<T, Args...> is true and the variable definition for is_­constructible, as defined below, is known not to throw any exceptions ([expr.unary.noexcept]).
T and all types in the parameter pack Args shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­nothrow_­default_­constructible;
is_­nothrow_­constructible_­v<T> is true.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­nothrow_­copy_­constructible;
For a referenceable type T, the same result as is_­nothrow_­constructible_­v<T, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­nothrow_­move_­constructible;
For a referenceable type T, the same result as is_­nothrow_­constructible_­v<T, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class U>
struct is_­nothrow_­assignable;
is_­assignable_­v<T, U> is true and the assignment is known not to throw any exceptions ([expr.unary.noexcept]).
T and U shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­nothrow_­copy_­assignable;
For a referenceable type T, the same result as is_­nothrow_­assignable_­v<T&, const T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­nothrow_­move_­assignable;
For a referenceable type T, the same result as is_­nothrow_­assignable_­v<T&, T&&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T, class U>
struct is_­nothrow_­swappable_­with;
is_­swappable_­with_­v<T, U> is true and each swap expression of the definition of is_­swappable_­with<T, U> is known not to throw any exceptions ([expr.unary.noexcept]).
T and U shall be complete types, cv void, or arrays of unknown bound.
template <class T>
struct is_­nothrow_­swappable;
For a referenceable type T, the same result as is_­nothrow_­swappable_­with_­v<T&, T&>, otherwise false.
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct is_­nothrow_­destructible;
is_­destructible_­v<T> is true and the indicated destructor is known not to throw any exceptions ([expr.unary.noexcept]).
T shall be a complete type, cv void, or an array of unknown bound.
template <class T>
struct has_­virtual_­destructor;
T has a virtual destructor ([class.dtor])
If T is a non-union class type, T shall be a complete type.
template <class T>
struct has_­unique_­object_­representations;
For an array type T, the same result as has_­unique_­object_­representations_­v<remove_­all_­extents_­t<T>>, otherwise see below.
T shall be a complete type, cv void, or an array of unknown bound.

23.15.5 Type property queries [meta.unary.prop.query]

Table 38 — Type property queries
Template
Value
template <class T>
struct alignment_­of;
alignof(T).

Requires: alignof(T) shall be a valid expression ([expr.alignof])
template <class T>
struct rank;
If T names an array type, an integer value representing the number of dimensions of T; otherwise, 0.
template <class T,
unsigned I = 0>
struct extent;
If T is not an array type, or if it has rank less than or equal to I, or if I is 0 and T has type “array of unknown bound of U”, then 0; otherwise, the bound ([dcl.array]) of the I'th dimension of T, where indexing of I is zero-based

23.15.6 Relationships between types [meta.rel]

Table 39 — Type relationship predicates
Template
Condition
Comments
template <class T, class U>
struct is_­same;
T and U name the same type with the same cv-qualifications
template <class Base, class Derived>
struct is_­base_­of;
Base is a base class of Derived (Clause [class.derived]) without regard to cv-qualifiers or Base and Derived are not unions and name the same class type without regard to cv-qualifiers
If Base and Derived are non-union class types and are not possibly cv-qualified versions of the same type, Derived shall be a complete type.
[Note
:
Base classes that are private, protected, or ambiguous are, nonetheless, base classes.
end note
]
template <class From, class To>
struct is_­convertible;
see below
From and To shall be complete types, arrays of unknown bound, or cv void types.
template <class Fn, class... ArgTypes>
struct is_­invocable;
The expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) is well formed when treated as an unevaluated operand
Fn and all types in the parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.
template <class R, class Fn, class... ArgTypes>
struct is_­invocable_­r;
The expression INVOKE<R>(declval<Fn>(), declval<ArgTypes>()...) is well formed when treated as an unevaluated operand
Fn, R, and all types in the parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.
template <class Fn, class... ArgTypes>
struct is_­nothrow_­invocable;
is_­invocable_­v<
Fn, ArgTypes...> is true and the expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) is known not to throw any exceptions
Fn and all types in the parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.
template <class R, class Fn, class... ArgTypes>
struct is_­nothrow_­invocable_­r;
is_­invocable_­r_­v<
R, Fn, ArgTypes...> is true and the expression INVOKE<R>(declval<Fn>(), declval<ArgTypes>()...) is known not to throw any exceptions
Fn, R, and all types in the parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.

23.15.7.1 Const-volatile modifications [meta.trans.cv]

Table 40 — Const-volatile modifications
Template
Comments
template <class T>
struct remove_­const;
The member typedef type names the same type as T except that any top-level const-qualifier has been removed.
[Example
:
remove_­const_­t<const volatile int> evaluates to volatile int, whereas remove_­const_­t<const int*> evaluates to const int*.
end example
]
template <class T>
struct remove_­volatile;
The member typedef type names the same type as T except that any top-level volatile-qualifier has been removed.
[Example
:
remove_­volatile_­t<const volatile int> evaluates to const int, whereas remove_­volatile_­t<volatile int*> evaluates to volatile int*.
end example
]
template <class T>
struct remove_­cv;
The member typedef type shall be the same as T except that any top-level cv-qualifier has been removed.
[Example
:
remove_­cv_­t<const volatile int> evaluates to int, whereas remove_­cv_­t<const volatile int*> evaluates to const volatile int*.
end example
]
template <class T>
struct add_­const;
If T is a reference, function, or top-level const-qualified type, then type names the same type as T, otherwise T const.
template <class T>
struct add_­volatile;
If T is a reference, function, or top-level volatile-qualified type, then type names the same type as T, otherwise T volatile.
template <class T>
struct add_­cv;
The member typedef type names the same type as add_­const_­t<add_­volatile_­t<T>>.

23.15.7.2 Reference modifications [meta.trans.ref]

Table 41 — Reference modifications
Template
Comments
template <class T>
struct remove_­reference;
If T has type “reference to T1” then the member typedef type names T1; otherwise, type names T.
template <class T>
struct add_­lvalue_­reference;
If T names a referenceable type ([defns.referenceable]) then the member typedef type names T&; otherwise, type names T.
[Note
:
This rule reflects the semantics of reference collapsing ([dcl.ref]).
end note
]
template <class T>
struct add_­rvalue_­reference;
If T names a referenceable type then the member typedef type names T&&; otherwise, type names T.
[Note
:
This rule reflects the semantics of reference collapsing ([dcl.ref]).
For example, when a type T names a type T1&, the type add_­rvalue_­reference_­t<T> is not an rvalue reference.
end note
]

23.15.7.3 Sign modifications [meta.trans.sign]

Table 42 — Sign modifications
Template
Comments
template <class T>
struct make_­signed;
If T names a (possibly cv-qualified) signed integer type ([basic.fundamental]) then the member typedef type names the type T; otherwise, if T names a (possibly cv-qualified) unsigned integer type then type names the corresponding signed integer type, with the same cv-qualifiers as T; otherwise, type names the signed integer type with smallest rank ([conv.rank]) for which sizeof(T) == sizeof(type), with the same cv-qualifiers as T.

Requires: T shall be a (possibly cv-qualified) integral type or enumeration but not a bool type.
template <class T>
struct make_­unsigned;
If T names a (possibly cv-qualified) unsigned integer type ([basic.fundamental]) then the member typedef type names the type T; otherwise, if T names a (possibly cv-qualified) signed integer type then type names the corresponding unsigned integer type, with the same cv-qualifiers as T; otherwise, type names the unsigned integer type with smallest rank ([conv.rank]) for which sizeof(T) == sizeof(type), with the same cv-qualifiers as T.

Requires: T shall be a (possibly cv-qualified) integral type or enumeration but not a bool type.

23.15.7.4 Array modifications [meta.trans.arr]

Table 43 — Array modifications
Template
Comments
template <class T>
struct remove_­extent;
If T names a type “array of U”, the member typedef type shall be U, otherwise T.
[Note
:
For multidimensional arrays, only the first array dimension is removed.
For a type “array of const U”, the resulting type is const U.
end note
]
template <class T>
struct remove_­all_­extents;
If T is “multi-dimensional array of U”, the resulting member typedef type is U, otherwise T.

23.15.7.5 Pointer modifications [meta.trans.ptr]

Table 44 — Pointer modifications
Template
Comments
template <class T>
struct remove_­pointer;
If T has type “(possibly cv-qualified) pointer to T1” then the member typedef type names T1; otherwise, it names T.
template <class T>
struct add_­pointer;
If T names a referenceable type ([defns.referenceable]) or a cv void type then the member typedef type names the same type as remove_­reference_­t<T>*; otherwise, type names T.

23.15.7.6 Other transformations [meta.trans.other]

Table 45 — Other transformations
Template
Comments
template <size_­t Len,
size_­t Align
= default-alignment>
struct aligned_­storage;
The value of default-alignment shall be the most stringent alignment requirement for any C++ object type whose size is no greater than Len ([basic.types]).
The member typedef type shall be a POD type suitable for use as uninitialized storage for any object whose size is at most Len and whose alignment is a divisor of Align.

Requires: Len shall not be zero.
Align shall be equal to alignof(T) for some type T or to default-alignment.
template <size_­t Len,
class... Types>
struct aligned_­union;
The member typedef type shall be a POD type suitable for use as uninitialized storage for any object whose type is listed in Types; its size shall be at least Len.
The static member alignment_­value shall be an integral constant of type size_­t whose value is the strictest alignment of all types listed in Types.

Requires: At least one type is provided.
template <class T>
struct decay;
Let U be remove_­reference_­t<T>.
If is_­array_­v<U> is true, the member typedef type shall equal remove_­extent_­t<U>*.
If is_­function_­v<U> is true, the member typedef type shall equal add_­pointer_­t<U>.
Otherwise the member typedef type equals remove_­cv_­t<U>.
[Note
:
This behavior is similar to the lvalue-to-rvalue ([conv.lval]), array-to-pointer ([conv.array]), and function-to-pointer ([conv.func]) conversions applied when an lvalue expression is used as an rvalue, but also strips cv-qualifiers from class types in order to more closely model by-value argument passing.
end note
]
template <bool B, class T = void> struct enable_­if;
If B is true, the member typedef type shall equal T; otherwise, there shall be no member type.
template <bool B, class T, class F>
struct conditional;
If B is true, the member typedef type shall equal T.
If B is false, the member typedef type shall equal F.
template <class... T> struct common_­type;
Unless this trait is specialized (as specified in Note B, below), the member type shall be defined or omitted as specified in Note A, below.
If it is omitted, there shall be no member type.
Each type in the parameter pack T shall be complete, cv void, or an array of unknown bound.
template <class T>
struct underlying_­type;
The member typedef type names the underlying type of T.

Requires: T shall be a complete enumeration type ([dcl.enum])
template <class Fn,
class... ArgTypes>
struct invoke_­result;
If the expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) is well formed when treated as an unevaluated operand (Clause [expr]), the member typedef type names the type decltype(INVOKE(declval<Fn>(), declval<ArgTypes>()...)); otherwise, there shall be no member type.
Access checking is performed as if in a context unrelated to Fn and ArgTypes.
Only the validity of the immediate context of the expression is considered.
[Note
:
The compilation of the expression can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on.
Such side effects are not in the “immediate context” and can result in the program being ill-formed.
end note
]

Requires: Fn and all types in the parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.

23.16.4 Arithmetic on ratios [ratio.arithmetic]

Table 46 — Expressions used to perform ratio arithmetic
Type
Value of X
Value of Y
ratio_­add<R1, R2>
R1​::​num * R2​::​den +
R1​::​den * R2​::​den
R2​::​num * R1​::​den
ratio_­subtract<R1, R2>
R1​::​num * R2​::​den -
R1​::​den * R2​::​den
R2​::​num * R1​::​den
ratio_­multiply<R1, R2>
R1​::​num * R2​::​num
R1​::​den * R2​::​den
ratio_­divide<R1, R2>
R1​::​num * R2​::​den
R1​::​den * R2​::​num

23.17.3 Clock requirements [time.clock.req]

Table 47 — Clock requirements
Expression
Return type
Operational semantics
C1​::​rep
An arithmetic type or a class emulating an arithmetic type
The representation type of C1​::​duration.
C1​::​period
a specialization of ratio
The tick period of the clock in seconds.
C1​::​duration
chrono​::​duration<C1​::​rep, C1​::​period>
The duration type of the clock.
C1​::​time_­point
chrono​::​time_­point<C1> or chrono​::​time_­point<C2, C1​::​duration>
The time_­point type of the clock.
C1 and C2 shall refer to the same epoch.
C1​::​is_­steady
const bool
true if t1 <= t2 is always true and the time between clock ticks is constant, otherwise false.
C1​::​now()
C1​::​time_­point
Returns a time_­point object representing the current point in time.

24.1 General [strings.general]

Table 48 — Strings library summary
Subclause
Header(s)
Character traits
<string>
String classes
<string>
String view classes
<string_­view>
<cctype>
<cwctype>
Null-terminated sequence utilities
<cstring>
<cwchar>
<cstdlib>
<cuchar>

24.2.1 Character traits requirements [char.traits.require]

Table 49 — Character traits requirements
Expression
Return type
Assertion/note
Complexity
pre-/post-condition
X​::​char_­type
charT
(described in [char.traits.typedefs])
compile-time
X​::​int_­type
(described in [char.traits.typedefs])
compile-time
X​::​off_­type
(described in [char.traits.typedefs])
compile-time
X​::​pos_­type
(described in [char.traits.typedefs])
compile-time
X​::​state_­type
(described in [char.traits.typedefs])
compile-time
X​::​eq(c,d)
bool
Returns: whether c is to be treated as equal to d.
constant
X​::​lt(c,d)
bool
Returns: whether c is to be treated as less than d.
constant
X​::​compare(p,q,n)
int
Returns: 0 if for each i in [0,n), X​::​eq(p[i],q[i]) is true; else, a negative value if, for some j in [0,n), X​::​lt(p[j],q[j]) is true and for each i in [0,j) X​::​eq(p[i],q[i]) is true; else a positive value.
linear
X​::​length(p)
size_­t
Returns: the smallest i such that X​::​eq(p[i],charT()) is true.
linear
X​::​find(p,n,c)
const X​::​char_­type*
Returns: the smallest q in [p,p+n) such that X​::​eq(*q,c) is true, zero otherwise.
linear
X​::​move(s,p,n)
X​::​char_­type*
for each i in [0,n), performs X​::​assign(s[i],p[i]).
Copies correctly even where the ranges [p,p+n) and [s,s+n) overlap.

Returns: s.
linear
X​::​copy(s,p,n)
X​::​char_­type*
Requires: p not in [s,s+n).
Returns: s.

for each i in [0,n), performs X​::​assign(s[i],p[i]).
linear
X​::​assign(r,d)
(not used)
assigns r=d.
constant
X​::​assign(s,n,c)
X​::​char_­type*
for each i in [0,n), performs X​::​assign(s[i],c).

Returns: s.
linear
X​::​not_­eof(e)
int_­type
Returns: e if X​::​eq_­int_­type(e,X​::​eof()) is false, otherwise a value f such that X​::​eq_­int_­type(f,X​::​eof()) is false.
constant
X​::​to_­char_­type(e)
X​::​char_­type
Returns: if for some c, X​::​eq_­int_­type(e,X​::​to_­int_­type(c)) is true, c; else some unspecified value.
constant
X​::​to_­int_­type(c)
X​::​int_­type
Returns: some value e, constrained by the definitions of to_­char_­type and eq_­int_­type.
constant
X​::​eq_­int_­type(e,f)
bool
Returns: for all c and d, X​::​eq(c,d) is equal to X​::​eq_­int_­type(X​::​to_­int_­type(c), X​::​to_­int_­type(d)); otherwise, yields true if e and f are both copies of X​::​eof(); otherwise, yields false if one of e and f is a copy of X​::​eof() and the other is not; otherwise the value is unspecified.
constant
X​::​eof()
X​::​int_­type
Returns: a value e such that X​::​eq_­int_­type(e,X​::​to_­int_­type(c)) is false for all values c.
constant

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 50basic_­string(const Allocator&) effects
Element
Value
data()
a non-null pointer that is copyable and can have 0 added to it
size()
0
capacity()
an unspecified value

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 51basic_­string(const basic_­string&) effects
Element
Value
data()
points at the first element of an allocated copy of the array whose first element is pointed at by str.data()
size()
str.size()
capacity()
a value at least as large as size()

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 52basic_­string(const basic_­string&, size_­type, const Allocator&) and
basic_­string(const basic_­string&, size_­type, size_­type, const Allocator&) effects
Element
Value
data()
points at the first element of an allocated copy of rlen consecutive elements of the string controlled by str beginning at position pos
size()
rlen
capacity()
a value at least as large as size()

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 53basic_­string(const charT*, size_­type, const Allocator&) effects
Element
Value
data()
points at the first element of an allocated copy of the array whose first element is pointed at by s
size()
n
capacity()
a value at least as large as size()

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 54basic_­string(const charT*, const Allocator&) effects
Element
Value
data()
points at the first element of an allocated copy of the array whose first element is pointed at by s
size()
traits​::​length(s)
capacity()
a value at least as large as size()

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 55basic_­string(size_­t, charT, const Allocator&) effects
Element
Value
data()
points at the first element of an allocated array of n elements, each storing the initial value c
size()
n
capacity()
a value at least as large as size()

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 56basic_­string(const basic_­string&, const Allocator&)
and basic_­string(basic_­string&&, const Allocator&) effects
Element
Value
data()
points at the first element of an allocated copy of the array whose first element is pointed at by the original value of str.data().
size()
the original value of str.size()
capacity()
a value at least as large as size()
get_­allocator()
alloc

24.3.2.2 basic_­string constructors and assignment operators [string.cons]

Table 57operator=(const basic_­string&) effects
Element
Value
data()
points at the first element of an allocated copy of the array whose first element is pointed at by str.data()
size()
str.size()
capacity()
a value at least as large as size()

24.3.2.7.9 basic_­string​::​compare [string.compare]

Table 58compare() results
Condition
Return Value
size() <  sv.size()
< 0
size() == sv.size()
 0
size() >  sv.size()
> 0

24.4.2.1 Construction and assignment [string.view.cons]

Table 59basic_­string_­view(const charT*) effects
Element
Value
data_­
str
size_­
traits​::​length(str)

24.4.2.1 Construction and assignment [string.view.cons]

Table 60basic_­string_­view(const charT*, size_­type) effects
Element
Value
data_­
str
size_­
len

24.4.2.6 String operations [string.view.ops]

Table 61compare() results
Condition
Return Value
size() < str.size()
< 0
size() == str.size()
 0
size() > str.size()
> 0

24.4.3 Non-member comparison functions [string.view.comparison]

Table 62 — Additional basic_­string_­view comparison overloads
Expression
Equivalent to
t == sv
S(t) == sv
sv == t
sv == S(t)
t != sv
S(t) != sv
sv != t
sv != S(t)
t < sv
S(t) < sv
sv < t
sv < S(t)
t > sv
S(t) > sv
sv > t
sv > S(t)
t <= sv
S(t) <= sv
sv <= t
sv <= S(t)
t >= sv
S(t) >= sv
sv >= t
sv >= S(t)

25.1 General [localization.general]

Table 63 — Localization library summary
Subclause
Header(s)
Locales
<locale>
Standard locale Categories
C library locales
<clocale>

25.3.1.1.1 Type locale​::​category [locale.category]

Table 64 — Locale category facets
Category
Includes facets
collate
collate<char>, collate<wchar_­t>
ctype
ctype<char>, ctype<wchar_­t>
codecvt<char, char, mbstate_­t>
codecvt<char16_­t, char, mbstate_­t>
codecvt<char32_­t, char, mbstate_­t>
codecvt<wchar_­t, char, mbstate_­t>
monetary
moneypunct<char>, moneypunct<wchar_­t>
moneypunct<char, true>, moneypunct<wchar_­t, true>
money_­get<char>, money_­get<wchar_­t>
money_­put<char>, money_­put<wchar_­t>
numeric
numpunct<char>, numpunct<wchar_­t>
num_­get<char>, num_­get<wchar_­t>
num_­put<char>, num_­put<wchar_­t>
time
time_­get<char>, time_­get<wchar_­t>
time_­put<char>, time_­put<wchar_­t>
messages
messages<char>, messages<wchar_­t>

25.3.1.1.1 Type locale​::​category [locale.category]

Table 65 — Required specializations
Category
Includes facets
collate
collate_­byname<char>, collate_­byname<wchar_­t>
ctype
ctype_­byname<char>, ctype_­byname<wchar_­t>
codecvt_­byname<char, char, mbstate_­t>
codecvt_­byname<char16_­t, char, mbstate_­t>
codecvt_­byname<char32_­t, char, mbstate_­t>
codecvt_­byname<wchar_­t, char, mbstate_­t>
monetary
moneypunct_­byname<char, International>
moneypunct_­byname<wchar_­t, International>
money_­get<C, InputIterator>
money_­put<C, OutputIterator>
numeric
numpunct_­byname<char>, numpunct_­byname<wchar_­t>
num_­get<C, InputIterator>, num_­put<C, OutputIterator>
time
time_­get<char, InputIterator>
time_­get_­byname<char, InputIterator>
time_­get<wchar_­t, InputIterator>
time_­get_­byname<wchar_­t, InputIterator>
time_­put<char, OutputIterator>
time_­put_­byname<char, OutputIterator>
time_­put<wchar_­t, OutputIterator>
time_­put_­byname<wchar_­t, OutputIterator>
messages
messages_­byname<char>, messages_­byname<wchar_­t>

25.4.1.4.2 codecvt virtual functions [locale.codecvt.virtuals]

Table 66do_­in/do_­out result values
Value
Meaning
ok
completed the conversion
partial
not all source characters converted
error
encountered a character in [from, from_­end) that it could not convert
noconv
internT and externT are the same type, and input sequence is identical to converted sequence

25.4.1.4.2 codecvt virtual functions [locale.codecvt.virtuals]

Table 67do_­unshift result values
Value
Meaning
ok
completed the sequence
partial
space for more than to_­end - to destination elements was needed to terminate a sequence given the value of state
error
an unspecified error has occurred
noconv
no termination is needed for this state_­type

25.4.2.1.2 num_­get virtual functions [facet.num.get.virtuals]

Table 68 — Integer conversions
State
stdio equivalent
basefield == oct
%o
basefield == hex
%X
basefield == 0
%i
signed integral type
%d
unsigned integral type
%u

25.4.2.1.2 num_­get virtual functions [facet.num.get.virtuals]

Table 69 — Length modifier
Type
Length modifier
short
h
unsigned short
h
long
l
unsigned long
l
long long
ll
unsigned long long
ll
double
l
long double
L

25.4.2.2.2 num_­put virtual functions [facet.num.put.virtuals]

Table 70 — Integer conversions
State
stdio equivalent
basefield == ios_­base​::​oct
%o
(basefield == ios_­base​::​hex) && !uppercase
%x
(basefield == ios_­base​::​hex)
%X
for a signed integral type
%d
for an unsigned integral type
%u

25.4.2.2.2 num_­put virtual functions [facet.num.put.virtuals]

Table 71 — Floating-point conversions
State
stdio equivalent
floatfield == ios_­base​::​fixed
%f
floatfield == ios_­base​::​scientific && !uppercase
%e
floatfield == ios_­base​::​scientific
%E
floatfield == (ios_­base​::​fixed | ios_­base​::​scientific) && !uppercase
%a
floatfield == (ios_­base​::​fixed | ios_­base​::​scientific)
%A
!uppercase
%g
otherwise
%G

25.4.2.2.2 num_­put virtual functions [facet.num.put.virtuals]

Table 72 — Length modifier
Type
Length modifier
long
l
long long
ll
unsigned long
l
unsigned long long
ll
long double
L
otherwise
none

25.4.2.2.2 num_­put virtual functions [facet.num.put.virtuals]

Table 73 — Numeric conversions
Type(s)
State
stdio equivalent
an integral type
showpos
+
showbase
#
a floating-point type
showpos
+
showpoint
#

25.4.2.2.2 num_­put virtual functions [facet.num.put.virtuals]

Table 74 — Fill padding
State
Location
adjustfield == ios_­base​::​left
pad after
adjustfield == ios_­base​::​right
pad before
adjustfield == internal and a sign occurs in the representation
pad after the sign
adjustfield == internal and representation after stage 1 began with 0x or 0X
pad after x or X
otherwise
pad before

25.4.5.1.2 time_­get virtual functions [locale.time.get.virtuals]

Table 75do_­get_­date effects
date_­order()
Format
no_­order
"%m%d%y"
dmy
"%d%m%y"
mdy
"%m%d%y"
ymd
"%y%m%d"
ydm
"%y%d%m"

25.5.1 Header <clocale> synopsis [clocale.syn]

Table 76 — Potential setlocale data races
fprintf
isprint
iswdigit
localeconv
tolower
fscanf
ispunct
iswgraph
mblen
toupper
isalnum
isspace
iswlower
mbstowcs
towlower
isalpha
isupper
iswprint
mbtowc
towupper
isblank
iswalnum
iswpunct
setlocale
wcscoll
iscntrl
iswalpha
iswspace
strcoll
wcstod
isdigit
iswblank
iswupper
strerror
wcstombs
isgraph
iswcntrl
iswxdigit
strtod
wcsxfrm
islower
iswctype
isxdigit
strxfrm
wctomb

26.1 General [containers.general]

Table 77 — Containers library summary
Subclause
Header(s)
Requirements
Sequence containers
<array>
<deque>
<forward_­list>
<list>
<vector>
Associative containers
<map>
<set>
Unordered associative containers
<unordered_­map>
<unordered_­set>
Container adaptors
<queue>
<stack>

26.2.1 General container requirements [container.requirements.general]

Table 78 — Container requirements
Expression
Return type
Operational
Assertion/note
Complexity
semantics
pre-/post-condition
X​::​value_­type
T
Requires: T is Erasable from X (see [container.requirements.general], below)
compile time
X​::​reference
T&
compile time
X​::​const_­reference
const T&
compile time
X​::​iterator
iterator type whose value type is T
any iterator category that meets the forward iterator requirements.
convertible to X​::​const_­iterator.
compile time
X​::​const_­iterator
constant iterator type whose value type is T
any iterator category that meets the forward iterator requirements.
compile time
X​::​difference_­type
signed integer type
is identical to the difference type of X​::​iterator and X​::​const_­iterator
compile time
X​::​size_­type
unsigned integer type
size_­type can represent any non-negative value of difference_­type
compile time
X u;
Postconditions: u.empty()
constant
X()
Postconditions: X().empty()
constant
X(a)
Requires: T is CopyInsertable into X (see below).

Postconditions: a == X(a).
linear
X u(a);
X u = a;
Requires: T is CopyInsertable into X (see below).

Postconditions: u == a
linear
X u(rv);
X u = rv;
Postconditions: u shall be equal to the value that rv had before this construction
(Note B)
a = rv
X&
All existing elements of a are either move assigned to or destroyed
a shall be equal to the value that rv had before this assignment
linear
(&a)->~X()
void
the destructor is applied to every element of a; any memory obtained is deallocated.
linear
a.begin()
iterator; const_­iterator for constant a
constant
a.end()
iterator; const_­iterator for constant a
constant
a.cbegin()
const_­iterator
const_­cast<​X const&​>(a)​.begin();
constant
a.cend()
const_­iterator
const_­cast<​X const&​>(a)​.end();
constant
a == b
convertible to bool
== is an equivalence relation.
equal(​a.begin(), a.end(), b.begin(), b.end())
Requires: T is EqualityComparable
Constant if a.size() != b.size(), linear otherwise
a != b
convertible to bool
Equivalent to !(a == b)
linear
a.swap(b)
void
exchanges the contents of a and b
(Note A)
swap(a, b)
void
a.swap(b)
(Note A)
r = a
X&
Postconditions: r == a.
linear
a.size()
size_­type
distance(​a.begin(), a.end())
constant
a.max_­size()
size_­type
distance(​begin(), end()) for the largest possible container
constant
a.empty()
convertible to bool
a.begin() == a.end()
constant

26.2.1 General container requirements [container.requirements.general]

Table 79 — Reversible container requirements
Expression
Return type
Assertion/note
Complexity
pre-/post-condition
X​::​reverse_­iterator
iterator type whose value type is T
reverse_­iterator<iterator>
compile time
X​::​const_­reverse_­iterator
constant iterator type whose value type is T
reverse_­iterator<const_­iterator>
compile time
a.rbegin()
reverse_­iterator; const_­reverse_­iterator for constant a
reverse_­iterator(end())
constant
a.rend()
reverse_­iterator; const_­reverse_­iterator for constant a
reverse_­iterator(begin())
constant
a.crbegin()
const_­reverse_­iterator
const_­cast<X const&>(a).rbegin()
constant
a.crend()
const_­reverse_­iterator
const_­cast<X const&>(a).rend()
constant

26.2.1 General container requirements [container.requirements.general]

Table 80 — Optional container operations
Expression
Return type
Operational
Assertion/note
Complexity
semantics
pre-/post-condition
a < b
convertible to bool
lexicographical_­compare( a.begin(), a.end(), b.begin(), b.end())
Requires:< is defined for values of T.
< is a total ordering relationship.
linear
a > b
convertible to bool
b < a
linear
a <= b
convertible to bool
!(a > b)
linear
a >= b
convertible to bool
!(a < b)
linear

26.2.1 General container requirements [container.requirements.general]

Table 81 — Allocator-aware container requirements
Expression
Return type
Assertion/note
Complexity
pre-/post-condition
allocator_­type
A
Requires: allocator_­type​::​value_­type is the same as X​::​value_­type.
compile time
get_­- allocator()
A
constant
X()
X u;
Requires: A is DefaultConstructible.

Postconditions: u.empty() returns true, u.get_­allocator() == A()
constant
X(m)
Postconditions: u.empty() returns true,
constant
X u(m);
u.get_­allocator() == m
X(t, m)
X u(t, m);
Requires: T is CopyInsertable into X.

Postconditions: u == t, u.get_­allocator() == m
linear
X(rv)
X u(rv);
Postconditions: u shall have the same elements as rv had before this construction; the value of u.get_­allocator() shall be the same as the value of rv.get_­allocator() before this construction.
constant
X(rv, m)
X u(rv, m);
Requires: T is MoveInsertable into X.

Postconditions: u shall have the same elements, or copies of the elements, that rv had before this construction, u.get_­allocator() == m
constant if m == rv.get_­allocator(), otherwise linear
a = t
X&
Requires: T is CopyInsertable into X and CopyAssignable.

Postconditions: a == t
linear
a = rv
X&
Requires: If allocator_­-
traits<allocator_­type>
​::​propagate_­on_­container_­-
move_­assignment​::​value is
false, T is MoveInsertable into X and MoveAssignable.
All existing elements of a are either move assigned to or destroyed.

Postconditions: a shall be equal to the value that rv had before this assignment.
linear
a.swap(b)
void
exchanges the contents of a and b
constant

26.2.3 Sequence containers [sequence.reqmts]

Table 82 — Sequence container requirements (in addition to container)
Expression
Return type
Assertion/note
pre-/post-condition
X(n, t)
X u(n, t);
Requires: T shall be CopyInsertable into X.

Postconditions: distance(begin(), end()) == n
Constructs a sequence container with n copies of t
X(i, j)
X u(i, j);
Requires: T shall be EmplaceConstructible into X from *i.
For vector, if the iterator does not meet the forward iterator requirements ([forward.iterators]), T shall also be MoveInsertable into X.
Each iterator in the range [i, j) shall be dereferenced exactly once.

Postconditions: distance(begin(), end()) == distance(i, j)
Constructs a sequence container equal to the range [i, j)
X(il)
Equivalent to X(il.begin(), il.end())
a = il
X&
Requires: T is CopyInsertable into X and CopyAssignable.
Assigns the range [il.begin(), il.end()) into a.
All existing elements of a are either assigned to or destroyed.

Returns: *this.
a.emplace(p, args)
iterator
Requires: T is EmplaceConstructible into X from args.
For vector and deque, T is also MoveInsertable into X and MoveAssignable.
Effects: Inserts an object of type T constructed with std​::​forward<​Args​>(​args)... before p.
a.insert(p,t)
iterator
Requires: T shall be CopyInsertable into X.
For vector and deque, T shall also be CopyAssignable.

Effects: Inserts a copy of t before p.
a.insert(p,rv)
iterator
Requires: T shall be MoveInsertable into X.
For vector and deque, T shall also be MoveAssignable.

Effects: Inserts a copy of rv before p.
a.insert(p,n,t)
iterator
Requires: T shall be CopyInsertable into X and CopyAssignable.

Inserts n copies of t before p.
a.insert(p,i,j)
iterator
Requires: T shall be EmplaceConstructible into X from *i.
For vector and deque, T shall also be MoveInsertable into X, MoveConstructible, MoveAssignable, and swappable ([swappable.requirements]).
Each iterator in the range [i, j) shall be dereferenced exactly once.

Requires: i and j are not iterators into a.

Inserts copies of elements in [i, j) before p
a.insert(p, il)
iterator
a.insert(p, il.begin(), il.end()).
a.erase(q)
iterator
Requires: For vector and deque, T shall be MoveAssignable.

Effects: Erases the element pointed to by q.
a.erase(q1,q2)
iterator
Requires: For vector and deque, T shall be MoveAssignable.

Effects: Erases the elements in the range [q1, q2).
a.clear()
void
Destroys all elements in a.
Invalidates all references, pointers, and iterators referring to the elements of a and may invalidate the past-the-end iterator.

Postconditions: a.empty() returns true.

Complexity: Linear.
a.assign(i,j)
void
Requires: T shall be EmplaceConstructible into X from *i and assignable from *i.
For vector, if the iterator does not meet the forward iterator requirements ([forward.iterators]), T shall also be MoveInsertable into X.

Each iterator in the range [i, j) shall be dereferenced exactly once.

Requires: i, j are not iterators into a.

Replaces elements in a with a copy of [i, j).

Invalidates all references, pointers and iterators referring to the elements of a.
For vector and deque, also invalidates the past-the-end iterator.
a.assign(il)
void
a.assign(il.begin(), il.end()).
a.assign(n,t)
void
Requires: T shall be CopyInsertable into X and CopyAssignable.

Requires: t is not a reference into a.

Replaces elements in a with n copies of t.

Invalidates all references, pointers and iterators referring to the elements of a.
For vector and deque, also invalidates the past-the-end iterator.

26.2.3 Sequence containers [sequence.reqmts]

Table 83 — Optional sequence container operations
Expression
Return type
Operational semantics
Container
a.front()
reference; const_­reference for constant a
*a.begin()
basic_­string, array, deque, forward_­list, list, vector
a.back()
reference; const_­reference for constant a
{ auto tmp = a.end();
--tmp;
return *tmp; }
basic_­string, array, deque, list, vector
a.emplace_­front(args)
reference
Prepends an object of type T constructed with std​::​forward<​Args​>(​args)....

Requires: T shall be EmplaceConstructible into X from args.

Returns: a.front().
deque, forward_­list, list
a.emplace_­back(args)
reference
Appends an object of type T constructed with std​::​forward<​Args​>(​args)....

Requires: T shall be EmplaceConstructible into X from args.
For vector, T shall also be MoveInsertable into X.

Returns: a.back().
deque, list, vector
a.push_­front(t)
void
Prepends a copy of t.

Requires: T shall be CopyInsertable into X.
deque, forward_­list, list
a.push_­front(rv)
void
Prepends a copy of rv.

Requires: T shall be MoveInsertable into X.
deque, forward_­list, list
a.push_­back(t)
void
Appends a copy of t.

Requires: T shall be CopyInsertable into X.
basic_­string, deque, list, vector
a.push_­back(rv)
void
Appends a copy of rv.

Requires: T shall be MoveInsertable into X.
basic_­string, deque, list, vector
a.pop_­front()
void
Destroys the first element.

Requires: a.empty() shall be false.
deque, forward_­list, list
a.pop_­back()
void
Destroys the last element.

Requires: a.empty() shall be false.
basic_­string, deque, list, vector
a[n]
reference; const_­reference for constant a
*(a.begin() + n)
basic_­string, array, deque, vector
a.at(n)
reference; const_­reference for constant a
*(a.begin() + n)
basic_­string, array, deque, vector

26.2.4.1 node_­handle overview [container.node.overview]

Table 84 — Container types with compatible nodes
map<K, T, C1, A>
map<K, T, C2, A>
map<K, T, C1, A>
multimap<K, T, C2, A>
set<K, C1, A>
set<K, C2, A>
set<K, C1, A>
multiset<K, C2, A>
unordered_­map<K, T, H1, E1, A>
unordered_­map<K, T, H2, E2, A>
unordered_­map<K, T, H1, E1, A>
unordered_­multimap<K, T, H2, E2, A>
unordered_­set<K, H1, E1, A>
unordered_­set<K, H2, E2, A>
unordered_­set<K, H1, E1, A>
unordered_­multiset<K, H2, E2, A>

26.2.6 Associative containers [associative.reqmts]

Table 85 — Associative container requirements (in addition to container)
Expression
Return type
Assertion/note
Complexity
pre-/post-condition
X​::​key_­type
Key
compile time
X​::​mapped_­type (map and multimap only)
T
compile time
X​::​value_­type (set and multiset only)
Key
Requires: value_­type is Erasable from X
compile time
X​::​value_­type (map and multimap only)
pair<const Key, T>
Requires: value_­type is Erasable from X
compile time
X​::​key_­compare
Compare
Requires: key_­compare is CopyConstructible.
compile time
X​::​value_­compare
a binary predicate type
is the same as key_­compare for set and multiset; is an ordering relation on pairs induced by the first component (i.e., Key) for map and multimap.
compile time
X​::​node_­type
a specialization of a node_­handle class template, such that the public nested types are the same types as the corresponding types in X.
compile time
X(c)
X u(c);
Effects: Constructs an empty container.
Uses a copy of c as a comparison object.
constant
X()
X u;
Requires: key_­compare is DefaultConstructible.

Effects: Constructs an empty container.
Uses Compare() as a comparison object
constant
X(i,j,c)
X u(i,j,c);
Requires: value_­type is EmplaceConstructible into X from *i.

Effects: Constructs an empty container and inserts elements from the range [i, j) into it; uses c as a comparison object.
in general, where N has the value distance(i, j); linear if [i, j) is sorted with value_­comp()
X(i,j)
X u(i,j);
Requires: key_­compare is DefaultConstructible.
value_­type is EmplaceConstructible into X from *i.

Effects: Same as above, but uses Compare() as a comparison object.
same as above
X(il)
same as X(il.begin(), il.end())
same as X(il.begin(), il.end())
X(il,c)
same as X(il.begin(), il.end(), c)
same as X(il.begin(), il.end(), c)
a = il
X&
Requires: value_­type is CopyInsertable into X and CopyAssignable.

Effects: Assigns the range [il.begin(), il.end()) into a.
All existing elements of a are either assigned to or destroyed.
in general, where N has the value il.size() + a.size(); linear if [il.begin(), il.end()) is sorted with value_­comp()
b.key_­comp()
X​::​key_­compare
returns the comparison object out of which b was constructed.
constant
b.value_­comp()
X​::​value_­compare
returns an object of value_­compare constructed out of the comparison object
constant
a_­uniq.​emplace(​args)
pair<​iterator, bool>
Requires: value_­type shall be EmplaceConstructible into X from args.

Effects: Inserts a value_­type object t constructed with std​::​forward<​Args​>(​args)... if and only if there is no element in the container with key equivalent to the key of t.
The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
logarithmic
a_­eq.​emplace(​args)
iterator
Requires: value_­type shall be EmplaceConstructible into X from args.

Effects: Inserts a value_­type object t constructed with std​::​forward<​Args​>(​args)... and returns the iterator pointing to the newly inserted element.
If a range containing elements equivalent to t exists in a_­eq, t is inserted at the end of that range.
logarithmic
a.emplace_­hint(​p, args)
iterator
equivalent to a.emplace( std​::​forward<​Args​>(​args)...).
Return value is an iterator pointing to the element with the key equivalent to the newly inserted element.
The element is inserted as close as possible to the position just prior to p.
logarithmic in general, but amortized constant if the element is inserted right before p
a_­uniq.​insert(​t)
pair<​iterator, bool>
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Inserts t if and only if there is no element in the container with key equivalent to the key of t.
The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
logarithmic
a_­eq.​insert(​t)
iterator
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Inserts t and returns the iterator pointing to the newly inserted element.
If a range containing elements equivalent to t exists in a_­eq, t is inserted at the end of that range.
logarithmic
a.​insert(​p, t)
iterator
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Inserts t if and only if there is no element with key equivalent to the key of t in containers with unique keys; always inserts t in containers with equivalent keys.
Always returns the iterator pointing to the element with key equivalent to the key of t.
t is inserted as close as possible to the position just prior to p.
logarithmic in general, but amortized constant if t is inserted right before p.
a.​insert(​i, j)
void
Requires: value_­type shall be EmplaceConstructible into X from *i.

Requires: i, j are not iterators into a.
inserts each element from the range [i, j) if and only if there is no element with key equivalent to the key of that element in containers with unique keys; always inserts that element in containers with equivalent keys.
, where N has the value distance(i, j)
a.​insert(​il)
void
equivalent to a.insert(il.begin(), il.end())
a_­uniq.​insert(​nh)
insert_­return_­type
Requires: nh is empty or a_­uniq.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect.
Otherwise, inserts the element owned by nh if and only if there is no element in the container with a key equivalent to nh.key().

Postconditions: If nh is empty, inserted is false, position is end(), and node is empty.
Otherwise if the insertion took place, inserted is true, position points to the inserted element, and node is empty; if the insertion failed, inserted is false, node has the previous value of nh, and position points to an element with a key equivalent to nh.key().
logarithmic
a_­eq.​insert(​nh)
iterator
Requires: nh is empty or a_­eq.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect and returns a_­eq.end().
Otherwise, inserts the element owned by nh and returns an iterator pointing to the newly inserted element.
If a range containing elements with keys equivalent to nh.key() exists in a_­eq, the element is inserted at the end of that range.

Postconditions: nh is empty.
logarithmic
a.​insert(​p, nh)
iterator
Requires: nh is empty or a.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect and returns a.end().
Otherwise, inserts the element owned by nh if and only if there is no element with key equivalent to nh.key() in containers with unique keys; always inserts the element owned by nh in containers with equivalent keys.
Always returns the iterator pointing to the element with key equivalent to nh.key().
The element is inserted as close as possible to the position just prior to p.

Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails.
logarithmic in general, but amortized constant if the element is inserted right before p.
a.​extract(​k)
node_­type
removes the first element in the container with key equivalent to k.
Returns a node_­type owning the element if found, otherwise an empty node_­type.
log(a.size())
a.​extract(​q)
node_­type
removes the element pointed to by q.
Returns a node_­type owning that element.
amortized constant
a.merge(a2)
void
Requires: a.get_­allocator() == a2.get_­allocator().

Attempts to extract each element in a2 and insert it into a using the comparison object of a.
In containers with unique keys, if there is an element in a with key equivalent to the key of an element from a2, then that element is not extracted from a2.

Postconditions: Pointers and references to the transferred elements of a2 refer to those same elements but as members of a.
Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into a, not into a2.

Throws: Nothing unless the comparison object throws.
, where N has the value a2.size().
a.erase(k)
size_­type
erases all elements in the container with key equivalent to k.
returns the number of erased elements.
a.erase(q)
iterator
erases the element pointed to by q.
Returns an iterator pointing to the element immediately following q prior to the element being erased.
If no such element exists, returns a.end().
amortized constant
a.erase(r)
iterator
erases the element pointed to by r.
Returns an iterator pointing to the element immediately following r prior to the element being erased.
If no such element exists, returns a.end().
amortized constant
a.erase(
q1, q2)
iterator
erases all the elements in the range [q1, q2).
Returns an iterator pointing to the element pointed to by q2 prior to any elements being erased.
If no such element exists, a.end() is returned.
, where N has the value distance(q1, q2).
a.clear()
void
a.erase(a.begin(),a.end())
Postconditions: a.empty() returns true.
linear in a.size().
b.find(k)
iterator; const_­iterator for constant b.
returns an iterator pointing to an element with the key equivalent to k, or b.end() if such an element is not found
logarithmic
a_­tran.
find(ke)
iterator; const_­iterator for constant a_­tran.
returns an iterator pointing to an element with key r such that !c(r, ke) && !c(ke, r), or a_­tran.end() if such an element is not found
logarithmic
b.count(k)
size_­type
returns the number of elements with key equivalent to k
a_­tran.
count(ke)
size_­type
returns the number of elements with key r such that !c(r, ke) && !c(ke, r)
b.lower_­bound(k)
iterator; const_­iterator for constant b.
returns an iterator pointing to the first element with key not less than k, or b.end() if such an element is not found.
logarithmic
a_­tran.
lower_­bound(kl)
iterator; const_­iterator for constant a_­tran.
returns an iterator pointing to the first element with key r such that !c(r, kl), or a_­tran.end() if such an element is not found.
logarithmic
b.upper_­bound(k)
iterator; const_­iterator for constant b.
returns an iterator pointing to the first element with key greater than k, or b.end() if such an element is not found.
logarithmic
a_­tran.
upper_­bound(ku)
iterator; const_­iterator for constant a_­tran.
returns an iterator pointing to the first element with key r such that c(ku, r), or a_­tran.end() if such an element is not found.
logarithmic
b.equal_­range(k)
pair<​iterator, iterator>; pair<​const_­iterator, const_­iterator> for constant b.
equivalent to make_­pair(b.lower_­bound(k), b.upper_­bound(k)).
logarithmic
a_­tran.
equal_­range(ke)
pair<​iterator, iterator>; pair<​const_­iterator, const_­iterator> for constant a_­tran.
equivalent to make_­pair(
a_­tran.lower_­bound(ke), a_­tran.upper_­bound(ke)).
logarithmic

26.2.7 Unordered associative containers [unord.req]

Table 86 — Unordered associative container requirements (in addition to container)
Expression
Return type
Assertion/note
Complexity
pre-/post-condition
X​::​key_­type
Key
compile time
X​::​mapped_­type (unordered_­map and unordered_­multimap only)
T
compile time
X​::​value_­type (unordered_­set and unordered_­multiset only)
Key
Requires: value_­type is Erasable from X
compile time
X​::​value_­type (unordered_­map and unordered_­multimap only)
pair<const Key, T>
Requires: value_­type is Erasable from X
compile time
X​::​hasher
Hash
Hash shall be a unary function object type such that the expression hf(k) has type size_­t.
compile time
X​::​key_­equal
Pred
Requires: Pred is CopyConstructible.

Pred shall be a binary predicate that takes two arguments of type Key.
Pred is an equivalence relation.
compile time
X​::​local_­iterator
An iterator type whose category, value type, difference type, and pointer and reference types are the same as X​::​iterator's.
A local_­iterator object may be used to iterate through a single bucket, but may not be used to iterate across buckets.
compile time
X​::​const_­local_­iterator
An iterator type whose category, value type, difference type, and pointer and reference types are the same as X​::​const_­iterator's.
A const_­local_­iterator object may be used to iterate through a single bucket, but may not be used to iterate across buckets.
compile time
X​::​node_­type
a specialization of a node_­handle class template, such that the public nested types are the same types as the corresponding types in X.
compile time
X(n, hf, eq)
X a(n, hf, eq);
X
Effects: Constructs an empty container with at least n buckets, using hf as the hash function and eq as the key equality predicate.
X(n, hf)
X a(n, hf);
X
Requires: key_­equal is DefaultConstructible.

Effects: Constructs an empty container with at least n buckets, using hf as the hash function and key_­equal() as the key equality predicate.
X(n)
X a(n);
X
Requires: hasher and key_­equal are DefaultConstructible.

Effects: Constructs an empty container with at least n buckets, using hasher() as the hash function and key_­equal() as the key equality predicate.
X()
X a;
X
Requires: hasher and key_­equal are DefaultConstructible.

Effects: Constructs an empty container with an unspecified number of buckets, using hasher() as the hash function and key_­equal() as the key equality predicate.
constant
X(i, j, n, hf, eq)
X a(i, j, n, hf, eq);
X
Requires: value_­type is EmplaceConstructible into X from *i.

Effects: Constructs an empty container with at least n buckets, using hf as the hash function and eq as the key equality predicate, and inserts elements from [i, j) into it.
Average case (N is distance(i, j)), worst case
X(i, j, n, hf)
X a(i, j, n, hf);
X
Requires: key_­equal is DefaultConstructible.
value_­type is EmplaceConstructible into X from *i.

Effects: Constructs an empty container with at least n buckets, using hf as the hash function and key_­equal() as the key equality predicate, and inserts elements from [i, j) into it.
Average case (N is distance(i, j)), worst case
X(i, j, n)
X a(i, j, n);
X
Requires: hasher and key_­equal are DefaultConstructible.
value_­type is EmplaceConstructible into X from *i.

Effects: Constructs an empty container with at least n buckets, using hasher() as the hash function and key_­equal() as the key equality predicate, and inserts elements from [i, j) into it.
Average case (N is distance(i, j)), worst case
X(i, j)
X a(i, j);
X
Requires: hasher and key_­equal are DefaultConstructible.
value_­type is EmplaceConstructible into X from *i.

Effects: Constructs an empty container with an unspecified number of buckets, using hasher() as the hash function and key_­equal() as the key equality predicate, and inserts elements from [i, j) into it.
Average case (N is distance(i, j)), worst case
X(il)
X
Same as X(il.begin(), il.end()).
Same as X(il.begin(), il.end()).
X(il, n)
X
Same as X(il.begin(), il.end(), n).
Same as X(il.begin(), il.end(), n).
X(il, n, hf)
X
Same as X(il.begin(), il.end(), n, hf).
Same as X(il.begin(), il.end(), n, hf).
X(il, n, hf, eq)
X
Same as X(il.begin(), il.end(), n, hf, eq).
Same as X(il.begin(), il.end(), n, hf, eq).
X(b)
X a(b);
X
Copy constructor.
In addition to the requirements of Table 78, copies the hash function, predicate, and maximum load factor.
Average case linear in b.size(), worst case quadratic.
a = b
X&
Copy assignment operator.
In addition to the requirements of Table 78, copies the hash function, predicate, and maximum load factor.
Average case linear in b.size(), worst case quadratic.
a = il
X&
Requires: value_­type is CopyInsertable into X and CopyAssignable.

Effects: Assigns the range [il.begin(), il.end()) into a.
All existing elements of a are either assigned to or destroyed.
Same as a = X(il).
b.hash_­function()
hasher
Returns b's hash function.
constant
b.key_­eq()
key_­equal
Returns b's key equality predicate.
constant
a_­uniq. emplace(args)
pair<iterator, bool>
Requires: value_­type shall be EmplaceConstructible into X from args.

Effects: Inserts a value_­type object t constructed with std​::​forward<​Args​>(​args)... if and only if there is no element in the container with key equivalent to the key of t.
The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
Average case , worst case .
a_­eq.emplace(args)
iterator
Requires: value_­type shall be EmplaceConstructible into X from args.

Effects: Inserts a value_­type object t constructed with std​::​forward<​Args>(​args)... and returns the iterator pointing to the newly inserted element.
Average case , worst case .
a.emplace_­hint(p, args)
iterator
Requires: value_­type shall be EmplaceConstructible into X from args.

Effects: Equivalent to a.emplace( std​::​forward<​Args>(​args)...).
Return value is an iterator pointing to the element with the key equivalent to the newly inserted element.
The const_­iterator p is a hint pointing to where the search should start.
Implementations are permitted to ignore the hint.
Average case , worst case .
a_­uniq.insert(t)
pair<iterator, bool>
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Inserts t if and only if there is no element in the container with key equivalent to the key of t.
The bool component of the returned pair indicates whether the insertion takes place, and the iterator component points to the element with key equivalent to the key of t.
Average case , worst case .
a_­eq.insert(t)
iterator
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Inserts t, and returns an iterator pointing to the newly inserted element.
Average case , worst case .
a.insert(p, t)
iterator
Requires: If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.

Effects: Equivalent to a.
insert(t).
Return value is an iterator pointing to the element with the key equivalent to that of t.
The iterator p is a hint pointing to where the search should start.
Implementations are permitted to ignore the hint.
Average case , worst case .
a.insert(i, j)
void
Requires: value_­type shall be EmplaceConstructible into X from *i.

Requires: i and j are not iterators in a.
Equivalent to a.insert(t) for each element in [i,j).
Average case , where N is distance(i, j).
Worst case .
a.insert(il)
void
Same as a.insert(il.begin(), il.end()).
Same as a.insert( il.begin(), il.end()).
a_­uniq.
insert(nh)
insert_­return_­type
Requires: nh is empty or a_­uniq.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect.
Otherwise, inserts the element owned by nh if and only if there is no element in the container with a key equivalent to nh.key().

Postconditions: If nh is empty, inserted is false, position is end(), and node is empty.
Otherwise if the insertion took place, inserted is true, position points to the inserted element, and node is empty; if the insertion failed, inserted is false, node has the previous value of nh, and position points to an element with a key equivalent to nh.key().
Average case , worst case .
a_­eq.
insert(nh)
iterator
Requires: nh is empty or a_­eq.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect and returns a_­eq.end().
Otherwise, inserts the element owned by nh and returns an iterator pointing to the newly inserted element.

Postconditions: nh is empty.
Average case , worst case .
a.insert(q, nh)
iterator
Requires: nh is empty or a.get_­allocator() == nh.get_­allocator().

Effects: If nh is empty, has no effect and returns a.end().
Otherwise, inserts the element owned by nh if and only if there is no element with key equivalent to nh.key() in containers with unique keys; always inserts the element owned by nh in containers with equivalent keys.
Always returns the iterator pointing to the element with key equivalent to nh.key().
The iterator q is a hint pointing to where the search should start.
Implementations are permitted to ignore the hint.

Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails.
Average case , worst case .
a.extract(k)
node_­type
Removes an element in the container with key equivalent to k.
Returns a node_­type owning the element if found, otherwise an empty node_­type.
Average case , worst case .
a.extract(q)
node_­type
Removes the element pointed to by q.
Returns a node_­type owning that element.
Average case , worst case .
a.merge(a2)
void
Requires: a.get_­allocator() == a2.get_­allocator().

Attempts to extract each element in a2 and insert it into a using the hash function and key equality predicate of a.
In containers with unique keys, if there is an element in a with key equivalent to the key of an element from a2, then that element is not extracted from a2.
Postconditions: Pointers and references to the transferred elements of a2 refer to those same elements but as members of a.
Iterators referring to the transferred elements and all iterators referring to a will be invalidated, but iterators to elements remaining in a2 will remain valid.

Throws: Nothing unless the hash function or key equality predicate throws.
Average case , where N is a2.size().
Worst case .
a.erase(k)
size_­type
Erases all elements with key equivalent to k.
Returns the number of elements erased.
Average case .
Worst case .
a.erase(q)
iterator
Erases the element pointed to by q.
Returns the iterator immediately following q prior to the erasure.
Average case , worst case .
a.erase(r)
iterator
Erases the element pointed to by r.
Returns the iterator immediately following r prior to the erasure.
Average case , worst case .
a.erase(q1, q2)
iterator
Erases all elements in the range [q1, q2).
Returns the iterator immediately following the erased elements prior to the erasure.
Average case linear in distance(q1, q2), worst case .
a.clear()
void
Erases all elements in the container.
Postconditions: a.empty() returns true
Linear in a.size().
b.find(k)
iterator;
const_­iterator for const b.
Returns an iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.
Average case , worst case .
b.count(k)
size_­type
Returns the number of elements with key equivalent to k.
Average case , worst case .
b.equal_­range(k)
pair<iterator, iterator>;
pair<const_­iterator, const_­iterator> for const b.
Returns a range containing all elements with keys equivalent to k.
Returns make_­pair(b.end(), b.end()) if no such elements exist.
Average case .
Worst case .
b.bucket_­count()
size_­type
Returns the number of buckets that b contains.
Constant
b.max_­bucket_­count()
size_­type
Returns an upper bound on the number of buckets that b might ever contain.
Constant
b.bucket(k)
size_­type
Requires: b.bucket_­count() > 0.

Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.
Postconditions: the return value shall be in the range [0, b.bucket_­count()).
Constant
b.bucket_­size(n)
size_­type
Requires: n shall be in the range [0, b.bucket_­count()).
Returns the number of elements in the bucket.
b.begin(n)
local_­iterator;
const_­local_­iterator for const b.
Requires: n shall be in the range [0, b.bucket_­count()).
b.begin(n) returns an iterator referring to the first element in the bucket.
If the bucket is empty, then b.begin(n) == b.end(n).
Constant
b.end(n)
local_­iterator;
const_­local_­iterator for const b.
Requires: n shall be in the range [0, b.bucket_­count()).
b.end(n) returns an iterator which is the past-the-end value for the bucket.
Constant
b.cbegin(n)
const_­local_­iterator
Requires: n shall be in the range [0, b.bucket_­count()).
Note: [b.cbegin(n), b.cend(n)) is a valid range containing all of the elements in the bucket.
Constant
b.cend(n)
const_­local_­iterator
Requires: n shall be in the range [0, b.bucket_­count()).
Constant
b.load_­factor()
float
Returns the average number of elements per bucket.
Constant
b.max_­load_­factor()
float
Returns a positive number that the container attempts to keep the load factor less than or equal to.
The container automatically increases the number of buckets as necessary to keep the load factor below this number.
Constant
a.max_­load_­factor(z)
void
Requires: z shall be positive.
May change the container's maximum load factor, using z as a hint.
Constant
a.rehash(n)
void
Postconditions: a.bucket_­count() >= a.size() / a.max_­load_­factor() and a.bucket_­count() >= n.
Average case linear in a.size(), worst case quadratic.
a.reserve(n)
void
Same as a.rehash(ceil(n / a.max_­load_­factor())).
Average case linear in a.size(), worst case quadratic.

27.1 General [iterators.general]

Table 87 — Iterators library summary
Subclause
Header(s)
Requirements
Iterator primitives
<iterator>
Predefined iterators
Stream iterators

27.2.1 In general [iterator.requirements.general]

Table 88 — Relations among iterator categories
Random Access
Bidirectional
Forward
Input
Output

27.2.2 Iterator [iterator.iterators]

Table 89 — Iterator requirements
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
*r
unspecified
Requires: r is dereferenceable.
++r
X&

27.2.3 Input iterators [input.iterators]

Table 90 — Input iterator requirements (in addition to Iterator)
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
a != b
contextually convertible to bool
!(a == b)
Requires: (a, b) is in the domain of ==.
*a
reference, convertible to T
Requires: a is dereferenceable.

The expression
(void)*a, *a is equivalent to *a.

If a == b and (a, b) is in the domain of == then *a is equivalent to *b.
a->m
(*a).m
Requires: a is dereferenceable.
++r
X&
Requires: r is dereferenceable.

Postconditions: r is dereferenceable or r is past-the-end;
any copies of the previous value of r are no longer required either to be dereferenceable or to be in the domain of ==.
(void)r++
equivalent to (void)++r
*r++
convertible to T
{ T tmp = *r;
++r;
return tmp; }

27.2.4 Output iterators [output.iterators]

Table 91 — Output iterator requirements (in addition to Iterator)
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
*r = o
result is not used
Remarks: After this operation r is not required to be dereferenceable.

Postconditions: r is incrementable.
++r
X&
&r == &++r.

Remarks: After this operation r is not required to be dereferenceable.

Postconditions: r is incrementable.
r++
convertible to const X&
{ X tmp = r;
++r;
return tmp; }
Remarks: After this operation r is not required to be dereferenceable.

Postconditions: r is incrementable.
*r++ = o
result is not used
Remarks: After this operation r is not required to be dereferenceable.

Postconditions: r is incrementable.

27.2.5 Forward iterators [forward.iterators]

Table 92 — Forward iterator requirements (in addition to input iterator)
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
r++
convertible to const X&
{ X tmp = r;
++r;
return tmp; }
*r++
reference

27.2.6 Bidirectional iterators [bidirectional.iterators]

Table 93 — Bidirectional iterator requirements (in addition to forward iterator)
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
--r
X&
Requires: there exists s such that r == ++s.

Postconditions: r is dereferenceable.

--(++r) == r.

--r == --s implies r == s.

&r == &--r.
r--
convertible to const X&
{ X tmp = r;
--r;
return tmp; }
*r--
reference

27.2.7 Random access iterators [random.access.iterators]

Table 94 — Random access iterator requirements (in addition to bidirectional iterator)
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
r += n
X&
{ difference_­type m = n;
if (m >= 0)
while (m--)
++r;
else
while (m++)
--r;
return r; }
a + n
n + a
X
{ X tmp = a;
return tmp += n; }
a + n == n + a.
r -= n
X&
return r += -n;
Requires: the absolute value of n is in the range of representable values of difference_­type.
a - n
X
{ X tmp = a;
return tmp -= n; }
b - a
difference_­type
return n
Requires: there exists a value n of type difference_­type such that a + n == b.

b == a + (b - a).
a[n]
convertible to reference
*(a + n)
a < b
contextually convertible to bool
b - a > 0
< is a total ordering relation
a > b
contextually convertible to bool
b < a
> is a total ordering relation opposite to <.
a >= b
contextually convertible to bool
!(a < b)
a <= b
contextually convertible to bool.
!(a > b)

28.1 General [algorithms.general]

Table 95 — Algorithms library summary
Subclause
Header(s)
Non-modifying sequence operations
Mutating sequence operations
<algorithm>
Sorting and related operations
C library algorithms
<cstdlib>

29.1 General [numerics.general]

Table 96 — Numerics library summary
Subclause
Header(s)
Definitions
Requirements
Floating-point environment
<cfenv>
Complex numbers
<complex>
Random number generation
<random>
Numeric arrays
<valarray>
Generalized numeric operations
<numeric>
Mathematical functions for
<cmath>
floating-point types
<cstdlib>

29.6.1.2 Seed sequence requirements [rand.req.seedseq]

Table 97 — Seed sequence requirements
Expression
Return type
Pre/post-condition
Complexity
S​::​result_­type
T
T is an unsigned integer type ([basic.fundamental]) of at least 32 bits.
compile-time
S()
Creates a seed sequence with the same initial state as all other default-constructed seed sequences of type S.
constant
S(ib,ie)
Creates a seed sequence having internal state that depends on some or all of the bits of the supplied sequence .
S(il)
Same as S(il.begin(), il.end()).
same as S(il.begin(), il.end())
q.generate(rb,re)
void
Does nothing if rb == re.
Otherwise, fills the supplied sequence with 32-bit quantities that depend on the sequence supplied to the constructor and possibly also depend on the history of generate's previous invocations.
r.size()
size_­t
The number of 32-bit units that would be copied by a call to r.param.
constant
r.param(ob)
void
Copies to the given destination a sequence of 32-bit units that can be provided to the constructor of a second object of type S, and that would reproduce in that second object a state indistinguishable from the state of the first object.

29.6.1.3 Uniform random bit generator requirements [rand.req.urng]

Table 98 — Uniform random bit generator requirements
Expression
Return type
Pre/post-condition
Complexity
G​::​result_­type
T
T is an unsigned integer type ([basic.fundamental]).
compile-time
g()
T
Returns a value in the closed interval [G​::​min(), G​::​max()].
amortized constant
G​::​min()
T
Denotes the least value potentially returned by operator().
compile-time
G​::​max()
T
Denotes the greatest value potentially returned by operator().
compile-time

29.6.1.4 Random number engine requirements [rand.req.eng]

Table 99 — Random number engine requirements
Expression
Return type
Pre/post-condition
Complexity
E()
Creates an engine with the same initial state as all other default-constructed engines of type E.
E(x)
Creates an engine that compares equal to x.
E(s)
Creates an engine with initial state determined by s.
E(q)268
Creates an engine with an initial state that depends on a sequence produced by one call to q.generate.
same as complexity of q.generate called on a sequence whose length is size of state
e.seed()
void
Postconditions: e == E().
same as E()
e.seed(s)
void
Postconditions: e == E(s).
same as E(s)
e.seed(q)
void
Postconditions: e == E(q).
same as E(q)
e()
T
Advances e's state e to e e) and returns GA(e).
per Table 98
e.discard(z) 269
void
Advances e's state e to e by any means equivalent to z consecutive calls e().
no worse than the complexity of z consecutive calls e()
x == y
bool
This operator is an equivalence relation.
With and as the infinite sequences of values that would be generated by repeated future calls to x() and y(), respectively, returns true if ; else returns false.
x != y
bool
!(x == y).
os << x
reference to the type of os
With os.fmtflags set to ios_­base​::​dec|ios_­base​::​left and the fill character set to the space character, writes to os the textual representation of x's current state.
In the output, adjacent numbers are separated by one or more space characters.
Postconditions: The os.fmtflags and fill character are unchanged.
is >> v
reference to the type of is
With is.fmtflags set to ios_­base​::​dec, sets v's state as determined by reading its textual representation from is.
If bad input is encountered, ensures that v's state is unchanged by the operation and calls is.setstate(ios​::​failbit) (which may throw ios​::​failure ([iostate.flags])).
If a textual representation written via os << x was subsequently read via is >> v, then x == v provided that there have been no intervening invocations of x or of v.
Requires: is provides a textual representation that was previously written using an output stream whose imbued locale was the same as that of is, and whose type's template specialization arguments charT and traits were respectively the same as those of is.
Postconditions: The is.fmtflags are unchanged.

29.6.1.6 Random number distribution requirements [rand.req.dist]

Table 100 — Random number distribution requirements
Expression
Return type
Pre/post-condition
Complexity
D​::​result_­type
T
T is an arithmetic type ([basic.fundamental]).
compile-time
D​::​param_­type
P
compile-time
D()
Creates a distribution whose behavior is indistinguishable from that of any other newly default-constructed distribution of type D.
constant
D(p)
Creates a distribution whose behavior is indistinguishable from that of a distribution newly constructed directly from the values used to construct p.
same as p's construction
d.reset()
void
Subsequent uses of d do not depend on values produced by any engine prior to invoking reset.
constant
x.param()
P
Returns a value p such that D(p).param() == p.
no worse than the complexity of D(p)
d.param(p)
void
Postconditions: d.param() == p.
no worse than the complexity of D(p)
d(g)
T
With , the sequence of numbers returned by successive invocations with the same object g is randomly distributed according to the associated p(z|{p}) or function.
amortized constant number of invocations of g
d(g,p)
T
The sequence of numbers returned by successive invocations with the same objects g and p is randomly distributed according to the associated p(z|{p}) or function.
amortized constant number of invocations of g
x.min()
T
Returns glb.
constant
x.max()
T
Returns lub.
constant
x == y
bool
This operator is an equivalence relation.
Returns true if x.param() == y.param() and , where and are the infinite sequences of values that would be generated, respectively, by repeated future calls to x(g1) and y(g2) whenever g1 == g2.
Otherwise returns false.
constant
x != y
bool
!(x == y).
same as x == y.
os << x
reference to the type of os
Writes to os a textual representation for the parameters and the additional internal data of x.
Postconditions: The os.fmtflags and fill character are unchanged.
is >> d
reference to the type of is
Restores from is the parameters and additional internal data of the lvalue d.
If bad input is encountered, ensures that d is unchanged by the operation and calls is.setstate(ios​::​failbit) (which may throw ios​::​failure ([iostate.flags])).
Requires: is provides a textual representation that was previously written using an os whose imbued locale and whose type's template specialization arguments charT and traits were the same as those of is.
Postconditions: The is.fmtflags are unchanged.

30.1 General [input.output.general]

Table 101 — Input/output library summary
Subclause
Header(s)
Requirements
Forward declarations
<iosfwd>
Standard iostream objects
<iostream>
Iostreams base classes
<ios>
Stream buffers
<streambuf>
Formatting and manipulators
<istream>
<ostream>
<iomanip>
String streams
<sstream>
File streams
<fstream>
File systems
<filesystem>
C library files
<cstdio>
<cinttypes>

30.5.3.1.2 Type ios_­base​::​fmtflags [ios::fmtflags]

Table 102fmtflags effects
Element
Effect(s) if set
boolalpha
insert and extract bool type in alphabetic format
dec
converts integer input or generates integer output in decimal base
fixed
generate floating-point output in fixed-point notation
hex
converts integer input or generates integer output in hexadecimal base
internal
adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated
left
adds fill characters on the right (final positions) of certain generated output
oct
converts integer input or generates integer output in octal base
right
adds fill characters on the left (initial positions) of certain generated output
scientific
generates floating-point output in scientific notation
showbase
generates a prefix indicating the numeric base of generated integer output
showpoint
generates a decimal-point character unconditionally in generated floating-point output
showpos
generates a + sign in non-negative generated numeric output
skipws
skips leading whitespace before certain input operations
unitbuf
flushes output after each output operation
uppercase
replaces certain lowercase letters with their uppercase equivalents in generated output

30.5.3.1.2 Type ios_­base​::​fmtflags [ios::fmtflags]

Table 103fmtflags constants
Constant
Allowable values
adjustfield
left | right | internal
basefield
dec | oct | hex
floatfield
scientific | fixed

30.5.3.1.3 Type ios_­base​::​iostate [ios::iostate]

Table 104iostate effects
Element
Effect(s) if set
badbit
indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file);
eofbit
indicates that an input operation reached the end of an input sequence;
failbit
indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters.

30.5.3.1.4 Type ios_­base​::​openmode [ios::openmode]

Table 105openmode effects
Element
Effect(s) if set
app
seek to end before each write
ate
open and seek to end immediately after opening
binary
perform input and output in binary mode (as opposed to text mode)
in
open for input
out
open for output
trunc
truncate an existing stream when opening

30.5.3.1.5 Type ios_­base​::​seekdir [ios::seekdir]

Table 106seekdir effects
Element
Meaning
beg
request a seek (for subsequent input or output) relative to the beginning of the stream
cur
request a seek relative to the current position within the sequence
end
request a seek relative to the current end of the sequence

30.5.4.2 fpos requirements [fpos.operations]

Table 107 — Position type requirements
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
P(i)
p == P(i)
note: a destructor is assumed.
P p(i);
P p = i;
Postconditions: p == P(i).
P(o)
fpos
converts from offset
O(p)
streamoff
converts to offset
P(O(p)) == p
p == q
convertible to bool
== is an equivalence relation
p != q
convertible to bool
!(p == q)
q = p + o
p += o
fpos
+ offset
q - o == p
q = p - o
p -= o
fpos
- offset
q + o == p
o = p - q
streamoff
distance
q + o == p
streamsize(o)
O(sz)
streamsize
streamoff
converts
converts
streamsize(O(sz)) == sz
streamsize(O(sz)) == sz

30.5.5.2 basic_­ios constructors [basic.ios.cons]

Table 108basic_­ios​::​init() effects
Element
Value
rdbuf()
sb
tie()
0
rdstate()
goodbit if sb is not a null pointer, otherwise badbit.
exceptions()
goodbit
flags()
skipws | dec
width()
0
precision()
6
fill()
widen(' ')
getloc()
a copy of the value returned by locale()
iarray
a null pointer
parray
a null pointer

30.5.5.3 Member functions [basic.ios.members]

Table 109basic_­ios​::​copyfmt() effects
Element
Value
rdbuf()
unchanged
tie()
rhs.tie()
rdstate()
unchanged
exceptions()
rhs.exceptions()
flags()
rhs.flags()
width()
rhs.width()
precision()
rhs.precision()
fill()
rhs.fill()
getloc()
rhs.getloc()

30.8.2.4 Overridden virtual functions [stringbuf.virtuals]

Table 110seekoff positioning
Conditions
Result
(which & ios_­base​::​in) == ios_­base​::​in
positions the input sequence
(which & ios_­base​::​out) == ios_­base​::​out
positions the output sequence
(which & (ios_­base​::​in |
ios_­base​::​out)) ==
(ios_­base​::​in) |
ios_­base​::​out))
and way == either
ios_­base​::​beg or
ios_­base​::​end
positions both the input and the output sequences
Otherwise
the positioning operation fails.

30.8.2.4 Overridden virtual functions [stringbuf.virtuals]

Table 111newoff values
Condition
newoff Value
way == ios_­base​::​beg
0
way == ios_­base​::​cur
the next pointer minus the beginning pointer (xnext - xbeg).
way == ios_­base​::​end
the high mark pointer minus the beginning pointer (high_­mark - xbeg).

30.9.2.3 Member functions [filebuf.members]

Table 112 — File open modes
ios_­base flag combination
stdio equivalent
binary
in
out
trunc
app
+
"w"
+
+
"a"
+
"a"
+
+
"w"
+
"r"
+
+
"r+"
+
+
+
"w+"
+
+
+
"a+"
+
+
"a+"
+
+
"wb"
+
+
+
"ab"
+
+
"ab"
+
+
+
"wb"
+
+
"rb"
+
+
+
"r+b"
+
+
+
+
"w+b"
+
+
+
+
"a+b"
+
+
+
"a+b"

30.9.2.4 Overridden virtual functions [filebuf.virtuals]

Table 113seekoff effects
way Value
stdio Equivalent
basic_­ios​::​beg
SEEK_­SET
basic_­ios​::​cur
SEEK_­CUR
basic_­ios​::​end
SEEK_­END

30.10.9.1 filesystem_­error members [filesystem_error.members]

Table 114filesystem_­error(const string&, error_­code) effects
Expression
Value
runtime_­error​::​what()
what_­arg.c_­str()
code()
ec
path1().empty()
true
path2().empty()
true

30.10.9.1 filesystem_­error members [filesystem_error.members]

Table 115filesystem_­error(const string&, const path&, error_­code) effects
Expression
Value
runtime_­error​::​what()
what_­arg.c_­str()
code()
ec
path1()
Reference to stored copy of p1
path2().empty()
true

30.10.9.1 filesystem_­error members [filesystem_error.members]

Table 116filesystem_­error(const string&, const path&, const path&, error_­code) effects
Expression
Value
runtime_­error​::​what()
what_­arg.c_­str()
code()
ec
path1()
Reference to stored copy of p1
path2()
Reference to stored copy of p2

30.10.10.1 Enum path​::​format [fs.enum.path.format]

Table 117 — Enum path​::​format
Name
Meaning
native_­format
The native pathname format.
generic_­format
The generic pathname format.
auto_­format
The interpretation of the format of the character sequence is implementation-defined.
The implementation may inspect the content of the character sequence to determine the format.
[Note
:
For POSIX-based systems, native and generic formats are equivalent and the character sequence should always be interpreted in the same way.
end note
]

30.10.10.2 Enum class file_­type [fs.enum.file_type]

Table 118 — Enum class file_­type
Constant
Meaning
none
The type of the file has not been determined or an error occurred while trying to determine the type.
not_­found
Pseudo-type indicating the file was not found.
[Note
:
The file not being found is not considered an error while determining the type of a file.
end note
]
regular
Regular file
directory
Directory file
symlink
Symbolic link file
block
Block special file
character
Character special file
fifo
FIFO or pipe file
socket
Socket file
implementation-defined
Implementations that support file systems having file types in addition to the above file_­type types shall supply implementation-defined file_­type constants to separately identify each of those additional file types
unknown
The file exists but the type could not be determined

30.10.10.3 Enum class copy_­options [fs.enum.copy.opts]

Table 119 — Enum class copy_­options
Option group controlling copy_­file function effects for existing target files
Constant
Meaning
none
(Default) Error; file already exists.
skip_­existing
Do not overwrite existing file, do not report an error.
overwrite_­existing
Overwrite the existing file.
update_­existing
Overwrite the existing file if it is older than the replacement file.
Option group controlling copy function effects for sub-directories
Constant
Meaning
none
(Default) Do not copy sub-directories.
recursive
Recursively copy sub-directories and their contents.
Option group controlling copy function effects for symbolic links
Constant
Meaning
none
(Default) Follow symbolic links.
copy_­symlinks
Copy symbolic links as symbolic links rather than copying the files that they point to.
skip_­symlinks
Ignore symbolic links.
Option group controlling copy function effects for choosing the form of copying
Constant
Meaning
none
(Default) Copy content.
directories_­only
Copy directory structure only, do not copy non-directory files.
create_­symlinks
Make symbolic links instead of copies of files.
The source path shall be an absolute path unless the destination path is in the current directory.
create_­hard_­links
Make hard links instead of copies of files.

30.10.10.4 Enum class perms [fs.enum.perms]

Table 120 — Enum class perms
Name
Value
POSIX
Definition or notes
(octal)
macro
none
0
There are no permissions set for the file.
owner_­read
0400
S_­IRUSR
Read permission, owner
owner_­write
0200
S_­IWUSR
Write permission, owner
owner_­exec
0100
S_­IXUSR
Execute/search permission, owner
owner_­all
0700
S_­IRWXU
Read, write, execute/search by owner;
owner_­read | owner_­write | owner_­exec
group_­read
040
S_­IRGRP
Read permission, group
group_­write
020
S_­IWGRP
Write permission, group
group_­exec
010
S_­IXGRP
Execute/search permission, group
group_­all
070
S_­IRWXG
Read, write, execute/search by group;
group_­read | group_­write | group_­exec
others_­read
04
S_­IROTH
Read permission, others
others_­write
02
S_­IWOTH
Write permission, others
others_­exec
01
S_­IXOTH
Execute/search permission, others
others_­all
07
S_­IRWXO
Read, write, execute/search by others;
others_­read | others_­write | others_­exec
all
0777
owner_­all | group_­all | others_­all
set_­uid
04000
S_­ISUID
Set-user-ID on execution
set_­gid
02000
S_­ISGID
Set-group-ID on execution
sticky_­bit
01000
S_­ISVTX
Operating system dependent.
mask
07777
all | set_­uid | set_­gid | sticky_­bit
unknown
0xFFFF
The permissions are not known, such as when a file_­status object is created without specifying the permissions

30.10.10.5 Enum class perm_­options [fs.enum.perm.opts]

Table 121 — Enum class perm_­options
Name
Meaning
replace
permissions shall replace the file's permission bits with perm
add
permissions shall replace the file's permission bits with the bitwise OR of perm and the file's current permission bits.
remove
permissions shall replace the file's permission bits with the bitwise AND of the complement of perm and the file's current permission bits.
nofollow
permissions shall change the permissions of a symbolic link itself rather than the permissions of the file the link resolves to.

30.10.10.6 Enum class directory_­options [fs.enum.dir.opts]

Table 122 — Enum class directory_­options
Name
Meaning
none
(Default) Skip directory symlinks, permission denied is an error.
follow_­directory_­symlink
Follow rather than skip directory symlinks.
skip_­permission_­denied
Skip directories that would otherwise result in permission denied.

31.1 General [re.general]

Table 123 — Regular expressions library summary
Subclause
Header(s)
Definitions
Requirements
Constants
Exception type
Traits
Regular expression template
<regex>
Submatches
Match results
Algorithms
Iterators
Grammar

31.3 Requirements [re.req]

Table 124 — Regular expression traits class requirements
Expression
Return type
Assertion/note pre-/post-condition
X​::​char_­type
charT
The character container type used in the implementation of class template basic_­regex.
X​::​string_­type
basic_­string<charT>
X​::​locale_­type
A copy constructible type
A type that represents the locale used by the traits class.
X​::​char_­class_­type
A bitmask type ([bitmask.types]).
A bitmask type representing a particular character classification.
X​::​length(p)
size_­t
Yields the smallest i such that p[i] == 0.
Complexity is linear in i .
v.translate(c)
X​::​char_­type
Returns a character such that for any character d that is to be considered equivalent to c then v.translate(c) == v.translate(d).
v.translate_­nocase(c)
X​::​char_­type
For all characters C that are to be considered equivalent to c when comparisons are to be performed without regard to case, then v.translate_­nocase(c) == v.translate_­nocase(C).
v.transform(F1, F2)
X​::​string_­type
Returns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2).
v.transform_­primary(F1, F2)
X​::​string_­type
Returns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) when character case is not considered then v.transform_­primary(G1, G2) < v.transform_­primary(H1, H2).
v.lookup_­collatename(F1, F2)
X​::​string_­type
Returns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range [F1, F2).
Returns an empty string if the character sequence is not a valid collating element.
v.lookup_­classname(F1, F2, b)
X​::​char_­class_­type
Converts the character sequence designated by the iterator range [F1, F2) into a value of a bitmask type that can subsequently be passed to isctype.
Values returned from lookup_­classname can be bitwise or'ed together; the resulting value represents membership in either of the corresponding character classes.
If b is true, the returned bitmask is suitable for matching characters without regard to their case.
Returns 0 if the character sequence is not the name of a character class recognized by X.
The value returned shall be independent of the case of the characters in the sequence.
v.isctype(c, cl)
bool
Returns true if character c is a member of one of the character classes designated by cl, false otherwise.
v.value(c, I)
int
Returns the value represented by the digit c in base I if the character c is a valid digit in base I; otherwise returns -1.
[Note
:
The value of I will only be 8, 10, or 16.
end note
]
u.imbue(loc)
X​::​locale_­type
Imbues u with the locale loc and returns the previous locale used by u if any.
v.getloc()
X​::​locale_­type
Returns the current locale used by v, if any.

31.5.1 Bitmask type syntax_­option_­type [re.synopt]

Table 125syntax_­option_­type effects
Element
Effect(s) if set
icase
Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case.
nosubs
Specifies that no sub-expressions shall be considered to be marked, so that when a regular expression is matched against a character container sequence, no sub-expression matches shall be stored in the supplied match_­results structure.
optimize
Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed.
Otherwise it has no detectable effect on the program output.
collate
Specifies that character ranges of the form "[a-b]" shall be locale sensitive.
ECMAScript
Specifies that the grammar recognized by the regular expression engine shall be that used by ECMAScript in ECMA-262, as modified in [re.grammar].
basic
Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions.
extended
Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX, Base Definitions and Headers, Section 9, Regular Expressions.
awk
Specifies that the grammar recognized by the regular expression engine shall be that used by the utility awk in POSIX.
grep
Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep in POSIX.
egrep
Specifies that the grammar recognized by the regular expression engine shall be that used by the utility grep when given the -E option in POSIX.
multiline
Specifies that ^ shall match the beginning of a line and $ shall match the end of a line, if the ECMAScript engine is selected.

31.5.2 Bitmask type match_­flag_­type [re.matchflag]

Table 126regex_­constants​::​match_­flag_­type effects when obtaining a match against a character container sequence [first, last).
Element
Effect(s) if set
match_­not_­bol
The first character in the sequence [first, last) shall be treated as though it is not at the beginning of a line, so the character ^ in the regular expression shall not match [first, first).
match_­not_­eol
The last character in the sequence [first, last) shall be treated as though it is not at the end of a line, so the character "$" in the regular expression shall not match [last, last).
match_­not_­bow
The expression "\\b" shall not match the sub-sequence [first, first).
match_­not_­eow
The expression "\\b" shall not match the sub-sequence [last, last).
match_­any
If more than one match is possible then any match is an acceptable result.
match_­not_­null
The expression shall not match an empty sequence.
match_­continuous
The expression shall only match a sub-sequence that begins at first.
match_­prev_­avail
--first is a valid iterator position.
When this flag is set the flags match_­not_­bol and match_­not_­bow shall be ignored by the regular expression algorithms ([re.alg]) and iterators ([re.iter]).
format_­default
When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the ECMAScript replace function in ECMA-262, part 15.5.4.11 String.prototype.replace. In addition, during search and replace operations all non-overlapping occurrences of the regular expression shall be located and replaced, and sections of the input that did not match the expression shall be copied unchanged to the output string.
format_­sed
When a regular expression match is to be replaced by a new string, the new string shall be constructed using the rules used by the sed utility in POSIX.
format_­no_­copy
During a search and replace operation, sections of the character container sequence being searched that do not match the regular expression shall not be copied to the output string.
format_­first_­only
When specified during a search and replace operation, only the first occurrence of the regular expression shall be replaced.

31.5.3 Implementation-defined error_­type [re.err]

Table 127error_­type values in the C locale
Value
Error condition
error_­collate
The expression contained an invalid collating element name.
error_­ctype
The expression contained an invalid character class name.
error_­escape
The expression contained an invalid escaped character, or a trailing escape.
error_­backref
The expression contained an invalid back reference.
error_­brack
The expression contained mismatched [ and ].
error_­paren
The expression contained mismatched ( and ).
error_­brace
The expression contained mismatched { and }
error_­badbrace
The expression contained an invalid range in a {} expression.
error_­range
The expression contained an invalid character range, such as [b-a] in most encodings.
error_­space
There was insufficient memory to convert the expression into a finite state machine.
error_­badrepeat
One of *?+{ was not preceded by a valid regular expression.
error_­complexity
The complexity of an attempted match against a regular expression exceeded a pre-set level.
error_­stack
There was insufficient memory to determine whether the regular expression could match the specified character sequence.

31.7 Class template regex_­traits [re.traits]

Table 128 — Character class names and corresponding ctype masks
Narrow character name
Wide character name
Corresponding ctype_­base​::​mask value
"alnum"
L"alnum"
ctype_­base​::​alnum
"alpha"
L"alpha"
ctype_­base​::​alpha
"blank"
L"blank"
ctype_­base​::​blank
"cntrl"
L"cntrl"
ctype_­base​::​cntrl
"digit"
L"digit"
ctype_­base​::​digit
"d"
L"d"
ctype_­base​::​digit
"graph"
L"graph"
ctype_­base​::​graph
"lower"
L"lower"
ctype_­base​::​lower
"print"
L"print"
ctype_­base​::​print
"punct"
L"punct"
ctype_­base​::​punct
"space"
L"space"
ctype_­base​::​space
"s"
L"s"
ctype_­base​::​space
"upper"
L"upper"
ctype_­base​::​upper
"w"
L"w"
ctype_­base​::​alnum
"xdigit"
L"xdigit"
ctype_­base​::​xdigit

31.10.1 match_­results constructors [re.results.const]

Table 129match_­results assignment operator effects
Element
Value
ready()
m.ready()
size()
m.size()
str(n)
m.str(n) for all integers n < m.size()
prefix()
m.prefix()
suffix()
m.suffix()
(*this)[n]
m[n] for all integers n < m.size()
length(n)
m.length(n) for all integers n < m.size()
position(n)
m.position(n) for all integers n < m.size()

31.11.2 regex_­match [re.alg.match]

Table 130 — Effects of regex_­match algorithm
Element
Value
m.size()
1 + e.mark_­count()
m.empty()
false
m.prefix().first
first
m.prefix().second
first
m.prefix().matched
false
m.suffix().first
last
m.suffix().second
last
m.suffix().matched
false
m[0].first
first
m[0].second
last
m[0].matched
true
m[n].first
For all integers 0 < n < m.size(), the start of the sequence that matched sub-expression n.
Alternatively, if sub-expression n did not participate in the match, then last.
m[n].second
For all integers 0 < n < m.size(), the end of the sequence that matched sub-expression n.
Alternatively, if sub-expression n did not participate in the match, then last.
m[n].matched
For all integers 0 < n < m.size(), true if sub-expression n participated in the match, false otherwise.

31.11.3 regex_­search [re.alg.search]

Table 131 — Effects of regex_­search algorithm
Element
Value
m.size()
1 + e.mark_­count()
m.empty()
false
m.prefix().first
first
m.prefix().second
m[0].first
m.prefix().matched
m.prefix().first != m.prefix().second
m.suffix().first
m[0].second
m.suffix().second
last
m.suffix().matched
m.suffix().first != m.suffix().second
m[0].first
The start of the sequence of characters that matched the regular expression
m[0].second
The end of the sequence of characters that matched the regular expression
m[0].matched
true
m[n].first
For all integers 0 < n < m.size(), the start of the sequence that matched sub-expression n.
Alternatively, if sub-expression n did not participate in the match, then last.
m[n].second
For all integers 0 < n < m.size(), the end of the sequence that matched sub-expression n.
Alternatively, if sub-expression n did not participate in the match, then last .
m[n].matched
For all integers 0 < n < m.size(), true if sub-expression n participated in the match, false otherwise.

32.1 General [atomics.general]

Table 132 — Atomics library summary
Subclause
Header(s)
Order and Consistency
Lock-free Property
Atomic Types
<atomic>
Operations on Atomic Types
Flag Type and Operations
Fences

32.6.2 Specializations for integers [atomics.types.int]

Table 133 — Atomic arithmetic computations
key
Op
Computation
key
Op
Computation
add
+
addition
sub
-
subtraction
or
|
bitwise inclusive or
xor
^
bitwise exclusive or
and
&
bitwise and

32.6.3 Partial specialization for pointers [atomics.types.pointer]

Table 134 — Atomic pointer computations
Key
Op
Computation
Key
Op
Computation
add
+
addition
sub
-
subtraction

33.1 General [thread.general]

Table 135 — Thread support library summary
Subclause
Header(s)
Requirements
Threads
<thread>
Mutual exclusion
<mutex>
<shared_­mutex>
Condition variables
<condition_­variable>
Futures
<future>

D.5 C standard library headers [depr.c.headers]

Table 136 — C headers
<assert.h>
<inttypes.h>
<signal.h>
<stdio.h>
<wchar.h>
<complex.h>
<iso646.h>
<stdalign.h>
<stdlib.h>
<wctype.h>
<ctype.h>
<limits.h>
<stdarg.h>
<string.h>
<errno.h>
<locale.h>
<stdbool.h>
<tgmath.h>
<fenv.h>
<math.h>
<stddef.h>
<time.h>
<float.h>
<setjmp.h>
<stdint.h>
<uchar.h>

D.6.1.1 strstreambuf constructors [depr.strstreambuf.cons]

Table 137strstreambuf(streamsize) effects
Element
Value
strmode
dynamic
alsize
alsize_­arg
palloc
a null pointer
pfree
a null pointer

D.6.1.1 strstreambuf constructors [depr.strstreambuf.cons]

Table 138strstreambuf(void* (*)(size_­t), void (*)(void*)) effects
Element
Value
strmode
dynamic
alsize
an unspecified value
palloc
palloc_­arg
pfree
pfree_­arg

D.6.1.1 strstreambuf constructors [depr.strstreambuf.cons]

Table 139strstreambuf(charT*, streamsize, charT*) effects
Element
Value
strmode
0
alsize
an unspecified value
palloc
a null pointer
pfree
a null pointer

D.6.1.3 strstreambuf overridden virtual functions [depr.strstreambuf.virtuals]

Table 140seekoff positioning
Conditions
Result
(which & ios​::​in) != 0
positions the input sequence
(which & ios​::​out) != 0
positions the output sequence
(which & (ios​::​in |
ios​::​out)) == (ios​::​in |
ios​::​out)) and
way == either
ios​::​beg or
ios​::​end
positions both the input and the output sequences
Otherwise
the positioning operation fails.

D.6.1.3 strstreambuf overridden virtual functions [depr.strstreambuf.virtuals]

Table 141newoff values
Condition
newoff Value
way == ios​::​beg
0
way == ios​::​cur
the next pointer minus the beginning pointer (xnext - xbeg).
way == ios​::​end
seekhigh minus the beginning pointer (seekhigh - xbeg).