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
audit
axiom
final
override

5.11 Keywords [lex.key]

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

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.7.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

9.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

11.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)

11.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

12.6.3 Variadic templates [temp.variadic]

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

14.1 Conditional inclusion [cpp.cond]

Table 15_­_­has_­cpp_­attribute values
Attribute
Value
assert
201806L
carries_­dependency
200809L
deprecated
201309L
ensures
201806L
expects
201806L
fallthrough
201603L
likely
201803L
maybe_­unused
201603L
no_­unique_­address
201803L
nodiscard
201603L
noreturn
200809L
unlikely
201803L

14.8 Predefined macro names [cpp.predefined]

Table 16 — Feature-test macros
Macro name
Value
_­_­cpp_­aggregate_­bases
201603L
_­_­cpp_­aggregate_­nsdmi
201304L
_­_­cpp_­alias_­templates
200704L
_­_­cpp_­aligned_­new
201606L
_­_­cpp_­attributes
200809L
_­_­cpp_­binary_­literals
201304L
_­_­cpp_­capture_­star_­this
201603L
_­_­cpp_­constexpr
201603L
_­_­cpp_­decltype
200707L
_­_­cpp_­decltype_­auto
201304L
_­_­cpp_­deduction_­guides
201703L
_­_­cpp_­delegating_­constructors
200604L
_­_­cpp_­enumerator_­attributes
201411L
_­_­cpp_­explicit_­bool
201806L
_­_­cpp_­fold_­expressions
201603L
_­_­cpp_­generic_­lambdas
201304L
_­_­cpp_­guaranteed_­copy_­elision
201606L
_­_­cpp_­hex_­float
201603L
_­_­cpp_­if_­constexpr
201606L
_­_­cpp_­inheriting_­constructors
201511L
_­_­cpp_­init_­captures
201304L
_­_­cpp_­initializer_­lists
200806L
_­_­cpp_­inline_­variables
201606L
_­_­cpp_­lambdas
200907L
_­_­cpp_­namespace_­attributes
201411L
_­_­cpp_­noexcept_­function_­type
201510L
_­_­cpp_­nontype_­template_­args
201411L
_­_­cpp_­nontype_­template_­parameter_­auto
201606L
_­_­cpp_­nontype_­template_­parameter_­class
201806L
_­_­cpp_­nsdmi
200809L
_­_­cpp_­range_­based_­for
201603L
_­_­cpp_­raw_­strings
200710L
_­_­cpp_­ref_­qualifiers
200710L
_­_­cpp_­return_­type_­deduction
201304L
_­_­cpp_­rvalue_­references
200610L
_­_­cpp_­sized_­deallocation
201309L
_­_­cpp_­static_­assert
201411L
_­_­cpp_­structured_­bindings
201606L
_­_­cpp_­template_­template_­args
201611L
_­_­cpp_­threadsafe_­static_­init
200806L
_­_­cpp_­unicode_­characters
200704L
_­_­cpp_­unicode_­literals
200710L
_­_­cpp_­user_­defined_­literals
200809L
_­_­cpp_­variable_­templates
201304L
_­_­cpp_­variadic_­templates
200704L
_­_­cpp_­variadic_­using
201611L

15.1 General [library.general]

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

15.5.1.2 Headers [headers]

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

15.5.1.2 Headers [headers]

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

15.5.1.2 Headers [headers]

Table 20 — 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
localtime_­s
strerrorlen_­s
vsprintf_­s
wscanf_­s
L_­tmpnam_­s
strerror_­s
vsscanf_­s
mbsrtowcs_­s
strlen_­s
vswprintf_­s

15.5.1.3 Freestanding implementations [compliance]

Table 21 — C++ headers for freestanding implementations
Subclause
Header(s)
Types
<cstddef>
Implementation properties
<cfloat> <limits> <climits> <version>
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>
Bit manipulation
<bit>
Atomics
<atomic>

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 22Cpp17EqualityComparable 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.

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 23Cpp17LessThanComparable requirements
Expression
Return type
Requirement
a < b
convertible to bool

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 24Cpp17DefaultConstructible 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

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 25Cpp17MoveConstructible 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
]

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 26Cpp17CopyConstructible requirements (in addition to Cpp17MoveConstructible)
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)

15.5.3.1 Template argument requirements [utility.arg.requirements]

Table 27Cpp17MoveAssignable 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
]

15.5.3.1 Template argument requirements [utility.arg.requirements]

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

15.5.3.1 Template argument requirements [utility.arg.requirements]

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

15.5.3.3 Cpp17NullablePointer requirements [nullablepointer.requirements]

Table 30Cpp17NullablePointer requirements
Expression
Return type
Operational semantics
P u(np);
Ensures: u == nullptr
P u = np;
P(np)
Ensures: P(np) == nullptr
t = np
P&
Ensures: 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

15.5.3.4 Cpp17Hash requirements [hash.requirements]

Table 31Cpp17Hash 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.

15.5.3.5 Cpp17Allocator requirements [allocator.requirements]

Table 32 — 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.
r
a value of type T& obtained by the expression *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&&

15.5.3.5 Cpp17Allocator requirements [allocator.requirements]

Table 33Cpp17Allocator 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
same as p
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.

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

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

Ensures: The value of a is unchanged and is equal to u.
X u(std::move(b));
Shall not exit via an exception.

Ensures: 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

16.1 General [support.general]

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

16.3.1 General [support.limits.general]

Table 35 — Standard library feature-test macros
Macro name
Value
Header(s)
_­_­cpp_­lib_­addressof_­constexpr
201603L
<memory>
_­_­cpp_­lib_­allocator_­traits_­is_­always_­equal
201411L
<memory> <scoped_­allocator> <string> <deque> <forward_­list> <list> <vector> <map> <set> <unordered_­map> <unordered_­set>
_­_­cpp_­lib_­any
201606L
<any>
_­_­cpp_­lib_­apply
201603L
<tuple>
_­_­cpp_­lib_­array_­constexpr
201603L
<iterator> <array>
_­_­cpp_­lib_­as_­const
201510L
<utility>
_­_­cpp_­lib_­atomic_­is_­always_­lock_­free
201603L
<atomic>
_­_­cpp_­lib_­atomic_­ref
201806L
<atomic>
_­_­cpp_­lib_­bit_­cast
201806L
<bit>
_­_­cpp_­lib_­bool_­constant
201505L
<type_­traits>
_­_­cpp_­lib_­boyer_­moore_­searcher
201603L
<functional>
_­_­cpp_­lib_­byte
201603L
<cstddef>
_­_­cpp_­lib_­chrono
201611L
<chrono>
_­_­cpp_­lib_­clamp
201603L
<algorithm>
_­_­cpp_­lib_­complex_­udls
201309L
<complex>
_­_­cpp_­lib_­concepts
201806L
<concepts>
_­_­cpp_­lib_­constexpr_­swap_­algorithms
201806L
<algorithm>
_­_­cpp_­lib_­enable_­shared_­from_­this
201603L
<memory>
_­_­cpp_­lib_­exchange_­function
201304L
<utility>
_­_­cpp_­lib_­execution
201603L
<execution>
_­_­cpp_­lib_­filesystem
201703L
<filesystem>
_­_­cpp_­lib_­gcd_­lcm
201606L
<numeric>
_­_­cpp_­lib_­generic_­associative_­lookup
201304L
<map> <set>
_­_­cpp_­lib_­hardware_­interference_­size
201703L
<new>
_­_­cpp_­lib_­has_­unique_­object_­representations
201606L
<type_­traits>
_­_­cpp_­lib_­hypot
201603L
<cmath>
_­_­cpp_­lib_­incomplete_­container_­elements
201505L
<forward_­list> <list> <vector>
_­_­cpp_­lib_­integer_­sequence
201304L
<utility>
_­_­cpp_­lib_­integral_­constant_­callable
201304L
<type_­traits>
_­_­cpp_­lib_­invoke
201411L
<functional>
_­_­cpp_­lib_­is_­aggregate
201703L
<type_­traits>
_­_­cpp_­lib_­is_­final
201402L
<type_­traits>
_­_­cpp_­lib_­is_­invocable
201703L
<type_­traits>
_­_­cpp_­lib_­is_­null_­pointer
201309L
<type_­traits>
_­_­cpp_­lib_­is_­swappable
201603L
<type_­traits>
_­_­cpp_­lib_­launder
201606L
<new>
_­_­cpp_­lib_­list_­remove_­return_­type
201806L
<forward_­list> <list>
_­_­cpp_­lib_­logical_­traits
201510L
<type_­traits>
_­_­cpp_­lib_­make_­from_­tuple
201606L
<tuple>
_­_­cpp_­lib_­make_­reverse_­iterator
201402L
<iterator>
_­_­cpp_­lib_­make_­unique
201304L
<memory>
_­_­cpp_­lib_­map_­try_­emplace
201411L
<map>
_­_­cpp_­lib_­math_­special_­functions
201603L
<cmath>
_­_­cpp_­lib_­memory_­resource
201603L
<memory_­resource>
_­_­cpp_­lib_­node_­extract
201606L
<map> <set> <unordered_­map> <unordered_­set>
_­_­cpp_­lib_­nonmember_­container_­access
201411L
<iterator> <array> <deque> <forward_­list> <list> <map> <regex> <set> <string> <unordered_­map> <unordered_­set> <vector>
_­_­cpp_­lib_­not_­fn
201603L
<functional>
_­_­cpp_­lib_­null_­iterators
201304L
<iterator>
_­_­cpp_­lib_­optional
201606L
<optional>
_­_­cpp_­lib_­parallel_­algorithm
201603L
<algorithm> <numeric>
_­_­cpp_­lib_­quoted_­string_­io
201304L
<iomanip>
_­_­cpp_­lib_­raw_­memory_­algorithms
201606L
<memory>
_­_­cpp_­lib_­result_­of_­sfinae
201210L
<functional> <type_­traits>
_­_­cpp_­lib_­robust_­nonmodifying_­seq_­ops
201304L
<algorithm>
_­_­cpp_­lib_­sample
201603L
<algorithm>
_­_­cpp_­lib_­scoped_­lock
201703L
<mutex>
_­_­cpp_­lib_­shared_­mutex
201505L
<shared_­mutex>
_­_­cpp_­lib_­shared_­ptr_­arrays
201611L
<memory>
_­_­cpp_­lib_­shared_­ptr_­weak_­type
201606L
<memory>
_­_­cpp_­lib_­shared_­timed_­mutex
201402L
<shared_­mutex>
_­_­cpp_­lib_­string_­udls
201304L
<string>
_­_­cpp_­lib_­string_­view
201606L
<string> <string_­view>
_­_­cpp_­lib_­to_­chars
201611L
<utility>
_­_­cpp_­lib_­transformation_­trait_­aliases
201304L
<type_­traits>
_­_­cpp_­lib_­transparent_­operators
201510L
<memory> <functional>
_­_­cpp_­lib_­tuple_­element_­t
201402L
<tuple>
_­_­cpp_­lib_­tuples_­by_­type
201304L
<utility> <tuple>
_­_­cpp_­lib_­type_­trait_­variable_­templates
201510L
<type_­traits>
_­_­cpp_­lib_­uncaught_­exceptions
201411L
<exception>
_­_­cpp_­lib_­unordered_­map_­try_­emplace
201411L
<unordered_­map>
_­_­cpp_­lib_­variant
201606L
<variant>
_­_­cpp_­lib_­void_­t
201411L
<type_­traits>

17.1 General [concepts.general]

Table 36 — Fundamental concepts library summary
Subclause
Header(s)
Language-related concepts
<concepts>
Comparison concepts
Object concepts
Callable concepts

18.1 General [diagnostics.general]

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

19.1 General [utilities.general]

Table 38 — 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>
Type indexes
<typeindex>
Execution policies
<execution>
Primitive numeric conversions
<charconv>

19.6.3.3 Assignment [optional.assign]

Table 39optional::operator=(const optional&) effects
*this contains a value
*this does not contain a value
rhs contains a value
assigns *rhs to the contained value
initializes the contained value as if direct-non-list-initializing an object of type T with *rhs
rhs does not contain a value
destroys the contained value by calling val->T::~T()
no effect

19.6.3.3 Assignment [optional.assign]

Table 40optional::operator=(optional&&) effects
*this contains a value
*this does not contain a value
rhs contains a value
assigns std::move(*rhs) to the contained value
initializes the contained value as if direct-non-list-initializing an object of type T with std::move(*rhs)
rhs does not contain a value
destroys the contained value by calling val->T::~T()
no effect

19.6.3.3 Assignment [optional.assign]

Table 41optional::operator=(const optional<U>&) effects
*this contains a value
*this does not contain a value
rhs contains a value
assigns *rhs to the contained value
initializes the contained value as if direct-non-list-initializing an object of type T with *rhs
rhs does not contain a value
destroys the contained value by calling val->T::~T()
no effect

19.6.3.3 Assignment [optional.assign]

Table 42optional::operator=(optional<U>&&) effects
*this contains a value
*this does not contain a value
rhs contains a value
assigns std::move(*rhs) to the contained value
initializes the contained value as if direct-non-list-initializing an object of type T with std::move(*rhs)
rhs does not contain a value
destroys the contained value by calling val->T::~T()
no effect

19.6.3.4 Swap [optional.swap]

Table 43optional::swap(optional&) effects
*this contains a value
*this does not contain a value
rhs contains a value
calls swap(*(*this), *rhs)
initializes the contained value of *this as if direct-non-list-initializing an object of type T with the expression std::move(*rhs), followed by rhs.val->T::~T(); postcondition is that *this contains a value and rhs does not contain a value
rhs does not contain a value
initializes the contained value of rhs as if direct-non-list-initializing an object of type T with the expression std::move(*(*this)), followed by val->T::~T(); postcondition is that *this does not contain a value and rhs contains a value
no effect

19.15.4.1 Primary type categories [meta.unary.cat]

Table 44 — 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 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 data member
template<class T>
struct is_­member_­function_­pointer;
T is a pointer to 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])

19.15.4.2 Composite type traits [meta.unary.comp]

Table 45 — 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;
template<class T>
struct is_­fundamental;
template<class T>
struct is_­object;
T is an object type
template<class T>
struct is_­scalar;
template<class T>
struct is_­compound;
template<class T>
struct is_­member_­pointer;
T is a pointer-to-member type

19.15.4.3 Type properties [meta.unary.prop]

Table 46 — 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_­empty;
T is a class type, but not a union type, with no non-static data members other than subobjects of zero size, 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 ([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 template 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.
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 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, where U is remove_­all_­extents_­t<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 template 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 remove_­all_­extents_­t<T> is either a non-class type or a class type with a trivial destructor.
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 template 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.

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

Table 47 — 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 dimension of T, where indexing of I is zero-based

19.15.6 Relationships between types [meta.rel]

Table 48 — 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 ([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 From, class To>
struct is_­nothrow_­convertible;
is_­convertible_­v<From, To> is true and the conversion, as defined by is_­convertible, is known not to throw any exceptions ([expr.unary.noexcept])
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 template 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 template 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 template 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 template parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.

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

Table 49 — 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>>.

19.15.7.2 Reference modifications [meta.trans.ref]

Table 50 — 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 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
]

19.15.7.3 Sign modifications [meta.trans.sign]

Table 51 — Sign modifications
Template
Comments
template<class T>
struct make_­signed;
If T names a (possibly cv-qualified) signed integer type 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 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 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 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.

19.15.7.4 Array modifications [meta.trans.arr]

Table 52 — 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.

19.15.7.5 Pointer modifications [meta.trans.ptr]

Table 53 — 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 or a cv void type then the member typedef type names the same type as remove_­reference_­t<T>*; otherwise, type names T.

19.15.7.6 Other transformations [meta.trans.other]

Table 54 — Other transformations
Template
Comments
template<class T>
struct type_­identity;
The member typedef type names the type T.
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 trivial standard-layout 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 trivial standard-layout 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.
Each type in the template parameter pack Types shall be a complete object type.
template<class T>
struct remove_­cvref;
The member typedef type names the same type as remove_­cv_­t<remove_­reference_­t<T>>.
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 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 template parameter pack T shall be complete, cv void, or an array of unknown bound.
template<class, class, template<class> class, template<class> class> struct basic_­common_­reference;
Unless this trait is specialized (as specified in Note D, below), there shall be no member type.
template<class... T> struct common_­reference;
The member typedef-name type is defined or omitted as specified in Note C, below.
Each type in the parameter pack T shall be complete or cv void.
template<class T>
struct underlying_­type;
The member typedef type names the underlying type of T.

Requires: T shall be a complete enumeration type
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, 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 template parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound.

19.16.4 Arithmetic on ratios [ratio.arithmetic]

Table 55 — 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

20.1 General [strings.general]

Table 56 — 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>

20.2.1 Character traits requirements [char.traits.require]

Table 57 — 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

20.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

20.4.2.1 Construction and assignment [string.view.cons]

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

20.4.2.1 Construction and assignment [string.view.cons]

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

20.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

20.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)

21.1 General [containers.general]

Table 63 — 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>
Views
<span>

21.2.1 General container requirements [container.requirements.general]

Table 64 — Container requirements
Expression
Return type
Operational
Assertion/note
Complexity
semantics
pre-/post-condition
X::value_­type
T
Requires:  T is Cpp17Erasable 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;
Ensures: u.empty()
constant
X()
Ensures: X().empty()
constant
X(a)
Requires: T is Cpp17CopyInsertable into X (see below).

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

Ensures: u == a
linear
X u(rv);
X u = rv;
Ensures: 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 Cpp17EqualityComparable
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
Equivalent to a.swap(b)
(Note A)
r = a
X&
Ensures: 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

21.2.1 General container requirements [container.requirements.general]

Table 65 — 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

21.2.1 General container requirements [container.requirements.general]

Table 66 — 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

21.2.1 General container requirements [container.requirements.general]

Table 67 — 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 Cpp17DefaultConstructible.

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

Ensures: u == t, u.get_­allocator() == m
linear
X(rv)
X u(rv);
Ensures: 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 Cpp17MoveInsertable into X.

Ensures: 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 Cpp17CopyInsertable into X and Cpp17CopyAssignable.

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

Ensures: 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

21.2.3 Sequence containers [sequence.reqmts]

Table 68 — 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 Cpp17CopyInsertable into X.

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

Ensures: 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 Cpp17CopyInsertable into X and Cpp17CopyAssignable.
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 Cpp17EmplaceConstructible into X from args.
For vector and deque, T is also Cpp17MoveInsertable into X and Cpp17MoveAssignable.
Effects:  Inserts an object of type T constructed with std::forward<​Args​>(​args)... before p.
[Note
:
args may directly or indirectly refer to a value in a.
end note
]
a.insert(p,t)
iterator
Requires:  T shall be Cpp17CopyInsertable into X.
For vector and deque, T shall also be Cpp17CopyAssignable.

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

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

Inserts n copies of t before p.
a.insert(p,i,j)
iterator
Requires:  T shall be Cpp17EmplaceConstructible into X from *i.
For vector and deque, T shall also be Cpp17MoveInsertable into X, Cpp17MoveConstructible, Cpp17MoveAssignable, 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 Cpp17MoveAssignable.

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

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.

Ensures: a.empty() returns true.

Complexity: Linear.
a.assign(i,j)
void
Requires:  T shall be Cpp17EmplaceConstructible into X from *i and assignable from *i.
For vector, if the iterator does not meet the forward iterator requirements, T shall also be Cpp17MoveInsertable 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 Cpp17CopyInsertable into X and Cpp17CopyAssignable.

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.

21.2.3 Sequence containers [sequence.reqmts]

Table 69 — 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 Cpp17EmplaceConstructible 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 Cpp17EmplaceConstructible into X from args.
For vector, T shall also be Cpp17MoveInsertable into X.

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

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

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

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

Requires:  T shall be Cpp17MoveInsertable 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

21.2.4.1 Overview [container.node.overview]

Table 70 — 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>

21.2.6 Associative containers [associative.reqmts]

Table 71 — 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 Cpp17Erasable from X
compile time
X::value_­type (map and multimap only)
pair<const Key, T>
Requires:  value_­type is Cpp17Erasable from X
compile time
X::key_­compare
Compare
Requires:  key_­compare is Cpp17CopyConstructible.
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 Cpp17DefaultConstructible.

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 Cpp17EmplaceConstructible 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 Cpp17DefaultConstructible.
value_­type is Cpp17EmplaceConstructible 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 Cpp17CopyInsertable into X and Cpp17CopyAssignable.

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 Cpp17EmplaceConstructible 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 Cpp17EmplaceConstructible 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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 Cpp17EmplaceConstructible 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().

Ensures: 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.

Ensures: 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.

Ensures: 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.

Ensures: 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())
Ensures: 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.
contains(k)
bool
equivalent to b.find(k) != b.end()
logarithmic
a_­tran.
contains(ke)
bool
equivalent to a_­tran.find(ke) != a_­tran.end()
logarithmic
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

21.2.7 Unordered associative containers [unord.req]

Table 72 — 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 Cpp17Erasable from X
compile time
X::value_­type (unordered_­map and unordered_­multimap only)
pair<const Key, T>
Requires:  value_­type is Cpp17Erasable 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 Cpp17CopyConstructible.

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 Cpp17DefaultConstructible.

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 Cpp17DefaultConstructible.

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 Cpp17DefaultConstructible.

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 Cpp17EmplaceConstructible 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 Cpp17DefaultConstructible.
value_­type is Cpp17EmplaceConstructible 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 Cpp17DefaultConstructible.
value_­type is Cpp17EmplaceConstructible 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 Cpp17DefaultConstructible.
value_­type is Cpp17EmplaceConstructible 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 64, 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 64, 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 Cpp17CopyInsertable into X and Cpp17CopyAssignable.

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 Cpp17EmplaceConstructible 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 Cpp17EmplaceConstructible 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 Cpp17EmplaceConstructible 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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, value_­type shall be Cpp17MoveInsertable into X; otherwise, value_­type shall be Cpp17CopyInsertable 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 Cpp17EmplaceConstructible into X from *i.

Requires: i and j are not iterators in a.

Effects: 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().

Ensures: 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.

Ensures: 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.

Ensures: 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.
Ensures: 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.
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.
Ensures: 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.contains(k)
bool
Equivalent to b.find(k) != b.end()
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.
Ensures: 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 n 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()).
b.cbegin(n) returns an iterator referring to the first element in the bucket.
If the bucket is empty, then b.cbegin(n) == b.cend(n).
Constant
b.cend(n)
const_­local_­iterator
Requires: n shall be in the range [0, b.bucket_­count()).
b.cend(n) returns an iterator which is the past-the-end value for the bucket.
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
Ensures: 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.

22.1 General [iterators.general]

Table 73 — Iterators library summary
Subclause
Header(s)
Requirements
Iterator primitives
<iterator>
Iterator adaptors
Stream iterators
Range access
Container and view access

22.2.1 In general [iterator.requirements.general]

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

22.2.2 Cpp17Iterator [iterator.iterators]

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

22.2.3 Input iterators [input.iterators]

Table 76Cpp17InputIterator requirements (in addition to Cpp17Iterator)
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.

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

22.2.4 Output iterators [output.iterators]

Table 77Cpp17OutputIterator requirements (in addition to Cpp17Iterator)
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.

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

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

Ensures: 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.

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

Ensures: r is incrementable.

22.2.5 Forward iterators [forward.iterators]

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

22.2.6 Bidirectional iterators [bidirectional.iterators]

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

Ensures: 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

22.2.7 Random access iterators [random.access.iterators]

Table 80Cpp17RandomAccessIterator requirements (in addition to Cpp17BidirectionalIterator)
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)

23.1 General [algorithms.general]

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

24.1 General [numerics.general]

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

24.7.2.2 Seed sequence requirements [rand.req.seedseq]

Table 83 — Seed sequence requirements
Expression
Return type
Pre/post-condition
Complexity
S::result_­type
T
T is an unsigned integer type 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.

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

Table 84 — 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)246
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
Ensures: e == E().
same as E()
e.seed(s)
void
Ensures: e == E(s).
same as E(s)
e.seed(q)
void
Ensures: e == E(q).
same as E(q)
e()
T
Advances e's state e to e e) and returns GA(e).
e.discard(z) 247
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.
Ensures: 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.
Ensures: The is.fmtflags are unchanged.

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

Table 85 — Random number distribution requirements
Expression
Return type
Pre/post-condition
Complexity
D::result_­type
T
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
Ensures: 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.
Ensures: 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.
Ensures: The is.fmtflags are unchanged.

25.1 General [time.general]

Table 86 — Time library summary
Subclause
Header(s)
Cpp17Clock requirements
Time-related traits
<chrono>
Class template duration
Class template time_­point
Clocks
Civil calendar
Class template time_­of_­day
Time zones
Formatting
Parsing
C library time utilities
<ctime>

25.3 Cpp17Clock requirements [time.clock.req]

Table 87Cpp17Clock 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.

25.11 Formatting [time.format]

Table 88 — Meaning of format conversion specifiers
Specifier
Replacement
%a
The locale's abbreviated weekday name.
If the value does not contain a valid weekday, setstate(ios::failbit) is called.
%A
The locale's full weekday name.
If the value does not contain a valid weekday, setstate(ios::failbit) is called.
%b
The locale's abbreviated month name.
If the value does not contain a valid month, setstate(ios::failbit) is called.
%B
The locale's full month name.
If the value does not contain a valid month, setstate(ios::failbit) is called.
%c
The locale's date and time representation.
The modified command %Ec produces the locale's alternate date and time representation.
%C
The year divided by 100 using floored division.
If the result is a single decimal digit, it is prefixed with 0.
The modified command %EC produces the locale's alternative representation of the century.
%d
The day of month as a decimal number.
If the result is a single decimal digit, it is prefixed with 0.
The modified command %Od produces the locale's alternative representation.
%D
Equivalent to %m/%d/%y.
%e
The day of month as a decimal number.
If the result is a single decimal digit, it is prefixed with a space.
The modified command %Oe produces the locale's alternative representation.
%F
Equivalent to %Y-%m-%d.
%g
The last two decimal digits of the ISO week-based year.
If the result is a single digit it is prefixed by 0.
%G
The ISO week-based year as a decimal number.
If the result is less than four digits it is left-padded with 0 to four digits.
%h
Equivalent to %b.
%H
The hour (24-hour clock) as a decimal number.
If the result is a single digit, it is prefixed with 0.
The modified command %OH produces the locale's alternative representation.
%I
The hour (12-hour clock) as a decimal number.
If the result is a single digit, it is prefixed with 0.
The modified command %OI produces the locale's alternative representation.
%j
The day of the year as a decimal number.
Jan 1 is 001.
If the result is less than three digits, it is left-padded with 0 to three digits.
%m
The month as a decimal number.
Jan is 01.
If the result is a single digit, it is prefixed with 0.
The modified command %Om produces the locale's alternative representation.
%M
The minute as a decimal number.
If the result is a single digit, it is prefixed with 0.
The modified command %OM produces the locale's alternative representation.
%n
A new-line character.
%p
The locale's equivalent of the AM/PM designations associated with a 12-hour clock.
%r
The locale's 12-hour clock time.
%R
Equivalent to %H:%M.
%S
Seconds as a decimal number.
If the number of seconds is less than 10, the result is prefixed with 0.
If the precision of the input cannot be exactly represented with seconds, then the format is a decimal floating point number with a fixed format and a precision matching that of the precision of the input (or to a microseconds precision if the conversion to floating point decimal seconds cannot be made within 18 fractional digits).
The character for the decimal point is localized according to the locale.
The modified command %OS produces the locale's alternative representation.
%t
A horizontal-tab character.
%T
Equivalent to %H:%M:%S.
%u
The ISO weekday as a decimal number (1-7), where Monday is 1.
The modified command %Ou produces the locale's alternative representation.
%U
The week number of the year as a decimal number.
The first Sunday of the year is the first day of week 01.
Days of the same year prior to that are in week 00.
If the result is a single digit, it is prefixed with 0.
The modified command %OU produces the locale's alternative representation.
%V
The ISO week-based week number as a decimal number.
If the result is a single digit, it is prefixed with 0.
The modified command %OV produces the locale's alternative representation.
%w
The weekday as a decimal number (0-6), where Sunday is 0.
The modified command %Ow produces the locale's alternative representation.
%W
The week number of the year as a decimal number.
The first Monday of the year is the first day of week 01.
Days of the same year prior to that are in week 00.
If the result is a single digit, it is prefixed with 0.
The modified command %OW produces the locale's alternative representation.
%x
The locale's date representation.
The modified command %Ex produces the locale's alternate date representation.
%X
The locale's time representation.
The modified command %EX produces the locale's alternate time representation.
%y
The last two decimal digits of the year.
If the result is a single digit it is prefixed by 0.
%Y
The year as a decimal number.
If the result is less than four digits it is left-padded with 0 to four digits.
%z
The offset from UTC in the ISO 8601 format.
For example -0430 refers to 4 hours 30 minutes behind UTC.
If the offset is zero, +0000 is used.
The modified commands %Ez and %Oz insert a : between the hours and minutes: -04:30.
If the offset information is not available, setstate(ios_­base::failbit) shall be called.
%Z
The time zone abbreviation.
If the time zone abbreviation is not available, setstate(ios_­base::failbit) shall be called.
%%
A % character.

25.12 Parsing [time.parse]

Table 89 — Meaning of parse flags
Flag
Parsed value
%a
The locale's full or abbreviated case-insensitive weekday name.
%A
Equivalent to %a.
%b
The locale's full or abbreviated case-insensitive month name.
%B
Equivalent to %b.
%c
The locale's date and time representation.
The modified command %Ec interprets the locale's alternate date and time representation.
%C
The century as a decimal number.
The modified command %NC specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified commands %EC and %OC interpret the locale's alternative representation of the century.
%d
The day of the month as a decimal number.
The modified command %Nd specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified command %Ed interprets the locale's alternative representation of the day of the month.
%D
Equivalent to %m/%d/%y.
%e
Equivalent to %d and can be modified like %d.
%F
Equivalent to %Y-%m-%d.
If modified with a width N, the width is applied to only %Y.
%g
The last two decimal digits of the ISO week-based year.
The modified command %Ng specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
%G
The ISO week-based year as a decimal number.
The modified command %NG specifies the maximum number of characters to read.
If N is not specified, the default is 4.
Leading zeroes are permitted but not required.
%h
Equivalent to %b.
%H
The hour (24-hour clock) as a decimal number.
The modified command %NH specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified command %OH interprets the locale's alternative representation.
%I
The hour (12-hour clock) as a decimal number.
The modified command %NI specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
%j
The day of the year as a decimal number.
Jan 1 is 1.
The modified command %Nj specifies the maximum number of characters to read.
If N is not specified, the default is 3.
Leading zeroes are permitted but not required.
%m
The month as a decimal number.
Jan is 1.
The modified command %Nm specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified command %Om interprets the locale's alternative representation.
%M
The minutes as a decimal number.
The modified command %NM specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified command %OM interprets the locale's alternative representation.
%n
Matches one white space character.
[Note
:
%n, %t, and a space can be combined to match a wide range of white-space patterns.
For example, "%n " matches one or more white space characters, and "%n%t%t" matches one to three white space characters.
end note
]
%p
The locale's equivalent of the AM/PM designations associated with a 12-hour clock.
The command %I must precede %p in the format string.
%r
The locale's 12-hour clock time.
%R
Equivalent to %H:%M.
%S
The seconds as a decimal number.
The modified command %NS specifies the maximum number of characters to read.
If N is not specified, the default is 2 if the input time has a precision convertible to seconds.
Otherwise the default width is determined by the decimal precision of the input and the field is interpreted as a long double in a fixed format.
If encountered, the locale determines the decimal point character.
Leading zeroes are permitted but not required.
The modified command %OS interprets the locale's alternative representation.
%t
Matches zero or one white space characters.
%T
Equivalent to %H:%M:%S.
%u
The ISO weekday as a decimal number (1-7), where Monday is 1.
The modified command %Nu specifies the maximum number of characters to read.
If N is not specified, the default is 1.
Leading zeroes are permitted but not required.
The modified command %Ou interprets the locale's alternative representation.
%U
The week number of the year as a decimal number.
The first Sunday of the year is the first day of week 01.
Days of the same year prior to that are in week 00.
The modified command %NU specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
%V
The ISO week-based week number as a decimal number.
The modified command %NV specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
%w
The weekday as a decimal number (0-6), where Sunday is 0.
The modified command %Nw specifies the maximum number of characters to read.
If N is not specified, the default is 1.
Leading zeroes are permitted but not required.
The modified command %Ow interprets the locale's alternative representation.
%W
The week number of the year as a decimal number.
The first Monday of the year is the first day of week 01.
Days of the same year prior to that are in week 00.
The modified command %NW specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
%x
The locale's date representation.
The modified command %Ex produces the locale's alternate date representation.
%X
The locale's time representation.
The modified command %EX produces the locale's alternate time representation.
%y
The last two decimal digits of the year.
If the century is not otherwise specified (e.g. with %C), values in the range [69, 99] are presumed to refer to the years 1969 to 1999, and values in the range [00, 68] are presumed to refer to the years 2000 to 2068.
The modified command %Ny specifies the maximum number of characters to read.
If N is not specified, the default is 2.
Leading zeroes are permitted but not required.
The modified commands %Ey and %Oy interpret the locale's alternative representation.
%Y
The year as a decimal number.
The modified command %NY specifies the maximum number of characters to read.
If N is not specified, the default is 4.
Leading zeroes are permitted but not required.
The modified command %EY interprets the locale's alternative representation.
%z
The offset from UTC in the format [+|-]hh[mm].
For example -0430 refers to 4 hours 30 minutes behind UTC, and 04 refers to 4 hours ahead of UTC.
The modified commands %Ez and %Oz parse a : between the hours and minutes and render leading zeroes on the hour field optional: [+|-]h[h][:mm].
For example -04:30 refers to 4 hours 30 minutes behind UTC, and 4 refers to 4 hours ahead of UTC.
%Z
The time zone abbreviation or name.
A single word is parsed.
This word can only contain characters from the basic source character set ([lex.charset]) that are alphanumeric, or one of '_­', '/', '-', or '+'.
%%
A % character is extracted.

26.1 General [localization.general]

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

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

Table 91 — 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>

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

Table 92 — 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>

26.4.1.4.2 Virtual functions [locale.codecvt.virtuals]

Table 93do_­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

26.4.1.4.2 Virtual functions [locale.codecvt.virtuals]

Table 94do_­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

26.4.2.1.2 Virtual functions [facet.num.get.virtuals]

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

26.4.2.1.2 Virtual functions [facet.num.get.virtuals]

Table 96 — 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

26.4.2.2.2 Virtual functions [facet.num.put.virtuals]

Table 97 — 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

26.4.2.2.2 Virtual functions [facet.num.put.virtuals]

Table 98 — 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

26.4.2.2.2 Virtual functions [facet.num.put.virtuals]

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

26.4.2.2.2 Virtual functions [facet.num.put.virtuals]

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

26.4.2.2.2 Virtual functions [facet.num.put.virtuals]

Table 101 — 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

26.4.5.1.2 Virtual functions [locale.time.get.virtuals]

Table 102do_­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"

26.5.1 Header <clocale> synopsis [clocale.syn]

Table 103 — 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

27.1 General [input.output.general]

Table 104 — 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>
Synchronized output streams
<syncstream>
File systems
<filesystem>
C library files
<cstdio>
<cinttypes>

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

Table 105fmtflags 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

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

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

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

Table 107iostate 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.

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

Table 108openmode 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

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

Table 109seekdir 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

27.5.4.2 Requirements [fpos.operations]

Table 110 — Position type requirements
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
P(o)
P
converts from offset
Effects: Value-initializes the state object.
P p(o);
P p = o;
Effects: Value-initializes the state object.

Ensures: p == P(o)
P()
P
P(0)
P p;
P p(0);
O(p)
streamoff
converts to offset
P(O(p)) == p
p != q
convertible to bool
!(p == q)
p + o
P
+ offset
Remarks: With ql = p + o;, then: ql - o == p
pl += o
P&
+= offset
Remarks: With ql = pl; before the +=, then: pl - o == ql
p - o
P
- offset
Remarks: With ql = p - o;, then: ql + o == p
pl -= o
P&
-= offset
Remarks: With ql = pl; before the -=, then: pl + o == ql
o + p
convertible to P
p + o
P(o + p) == p + o
p - q
streamoff
distance
p == q + (p - q)

27.5.5.2 Constructors [basic.ios.cons]

Table 111basic_­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

27.5.5.3 Member functions [basic.ios.members]

Table 112basic_­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()

27.8.2.4 Overridden virtual functions [stringbuf.virtuals]

Table 113seekoff 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.

27.8.2.4 Overridden virtual functions [stringbuf.virtuals]

Table 114newoff 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).

27.9.2.3 Member functions [filebuf.members]

Table 115 — 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"

27.9.2.4 Overridden virtual functions [filebuf.virtuals]

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

27.11.9.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
]

27.11.9.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

27.11.9.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.

27.11.9.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

27.11.9.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.

27.11.9.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.

28.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

28.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 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.

28.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 object.
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].

See also: ECMA-262 15.10
basic
Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX.

See also: POSIX, Base Definitions and Headers, Section 9.3
extended
Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX.

See also: POSIX, Base Definitions and Headers, Section 9.4
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.

28.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 i