character | glyph | ||
U+0009 | character tabulation | ||
U+000b | line tabulation | ||
U+000c | form feed | ||
U+0020 | space | ||
U+000a | line feed | new-line | |
U+0021 | exclamation mark | ! | |
U+0022 | quotation mark | " | |
U+0023 | number sign | # | |
U+0024 | dollar sign | $ | |
U+0025 | percent sign | % | |
U+0026 | ampersand | & | |
U+0027 | apostrophe | ' | |
U+0028 | left parenthesis | ( | |
U+0029 | right parenthesis | ) | |
U+002a | asterisk | * | |
U+002b | plus sign | + | |
U+002c | comma | , | |
U+002d | hyphen-minus | - | |
U+002e | full stop | . | |
U+002f | solidus | / | |
U+0030 .. U+0039 | digit zero .. nine | 0 1 2 3 4 5 6 7 8 9 | |
U+003a | colon | : | |
U+003b | semicolon | ; | |
U+003c | less-than sign | < | |
U+003d | equals sign | = | |
U+003e | greater-than sign | > | |
U+003f | question mark | ? | |
U+0040 | commercial at | @ | |
U+0041 .. U+005a | latin capital letter a .. z | A B C D E F G H I J K L M | |
N O P Q R S T U V W X Y Z | |||
U+005b | left square bracket | [ | |
U+005c | reverse solidus | \ | |
U+005d | right square bracket | ] | |
U+005e | circumflex accent | ^ | |
U+005f | low line | _ | |
U+0060 | grave accent | ` | |
U+0061 .. U+007a | latin small letter a .. z | a b c d e f g h i j k l m | |
n o p q r s t u v w x y z | |||
U+007b | left curly bracket | { | |
U+007c | vertical line | | | |
U+007d | right curly bracket | } | |
U+007e | tilde | ~ |
character | ||
U+0000 | null | |
U+0007 | alert | |
U+0008 | backspace | |
U+000d | carriage return |
Alternative | Primary | Alternative | Primary | Alternative | Primary | |
<% | { | and | && | and_eq | &= | |
%> | } | bitor | | | or_eq | |= | |
<: | [ | or | || | xor_eq | ^= | |
:> | ] | xor | ^ | not | ! | |
%: | # | compl | ~ | not_eq | != | |
%:%: | ## | bitand | & |
alignas | constinit | false | public | true | |
alignof | const_cast | float | register | try | |
asm | continue | for | reinterpret_cast | typedef | |
auto | co_await | friend | requires | typeid | |
bool | co_return | goto | return | typename | |
break | co_yield | if | short | union | |
case | decltype | inline | signed | unsigned | |
catch | default | int | sizeof | using | |
char | delete | long | static | virtual | |
char8_t | do | mutable | static_assert | void | |
char16_t | double | namespace | static_cast | volatile | |
char32_t | dynamic_cast | new | struct | wchar_t | |
class | else | noexcept | switch | while | |
concept | enum | nullptr | template | ||
const | explicit | operator | this | ||
consteval | export | private | thread_local | ||
constexpr | extern | protected | throw |
and | and_eq | bitand | bitor | compl | not | |
not_eq | or | or_eq | xor | xor_eq |
integer-literal other than decimal-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 | |||
z or Z | the signed integer type corresponding | the signed integer type | |
to std::size_t ([support.types.layout]) | corresponding to std::size_t | ||
std::size_t | |||
Both u or U | std::size_t | std::size_t | |
and z or Z |
Encoding | Kind | Type | Associated char- | Example | |
prefix | acter encoding | ||||
none | char | ordinary literal | 'v' | ||
multicharacter literal | int | encoding | 'abcd' | ||
L | wchar_t | wide literal | L'w' | ||
encoding | |||||
u8 | char8_t | UTF-8 | u8'x' | ||
u | char16_t | UTF-16 | u'y' | ||
U | char32_t | UTF-32 | U'z' |
character | |||
U+000a | line feed | \n | |
U+0009 | character tabulation | \t | |
U+000b | line tabulation | \v | |
U+0008 | backspace | \b | |
U+000d | carriage return | \r | |
U+000c | form feed | \f | |
U+0007 | alert | \a | |
U+005c | reverse solidus | \\ | |
U+003f | question mark | \? | |
U+0027 | apostrophe | \' | |
U+0022 | quotation mark | \" |
type | ||
none | double | |
f or F | float | |
l or L | long double | |
f16 or F16 | std::float16_t | |
f32 or F32 | std::float32_t | |
f64 or F64 | std::float64_t | |
f128 or F128 | std::float128_t | |
bf16 or BF16 | std::bfloat16_t |
Encoding | Kind | Type | Associated | Examples | |
prefix | character | ||||
encoding | |||||
none | array of n const char | ordinary literal encoding | "ordinary string" R"(ordinary raw string)" | ||
L | array of n const wchar_t | wide literal encoding | L"wide string" LR"w(wide raw string)w" | ||
u8 | array of n const char8_t | UTF-8 | u8"UTF-8 string" u8R"x(UTF-8 raw string)x" | ||
u | array of n const char16_t | UTF-16 | u"UTF-16 string" uR"y(UTF-16 raw string)y" | ||
U | array of n const char32_t | UTF-32 | U"UTF-32 string" UR"z(UTF-32 raw string)z" |
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" |
Type | Minimum width N | |
signed char | 8 | |
short int | 16 | |
int | 16 | |
long int | 32 | |
long long int | 64 |
Parameter | float16_t | float32_t | float64_t | float128_t | bfloat16_t | |
ISO/IEC/IEEE 60559 name | binary16 | binary32 | binary64 | binary128 | ||
k, storage width in bits | 16 | 32 | 64 | 128 | 16 | |
p, precision in bits | 11 | 24 | 53 | 113 | 8 | |
emax, maximum exponent | 15 | 127 | 1023 | 16383 | 127 | |
w, exponent field width in bits | 5 | 8 | 11 | 15 | 8 |
no cv-qualifier | < | const | |
no cv-qualifier | < | volatile | |
no cv-qualifier | < | const volatile | |
const | < | const volatile | |
volatile | < | const volatile |
Specifier(s) | Type | |
the type named | ||
the type as defined in [temp.names] | ||
the type as defined in [dcl.type.decltype] | ||
the type as defined in [dcl.type.pack.index] | ||
the type as defined in [dcl.spec.auto] | ||
the type as defined in [dcl.type.class.deduct] | ||
char | “char” | |
unsigned char | “unsigned char” | |
signed char | “signed char” | |
char8_t | “char8_t” | |
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” |
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) |
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 | Promotion | Promotion | ||
Integral conversions | ||||
Floating-point conversions | ||||
Floating-integral conversions | ||||
Pointer conversions | Conversion | Conversion | ||
Pointer-to-member conversions | ||||
Boolean conversions |
Operator | Value when pack is empty | |
&& | true | |
|| | false | |
, | void() |
Attribute | Value | |
assume | 202207L | |
carries_dependency | 200809L | |
deprecated | 201309L | |
fallthrough | 201603L | |
likely | 201803L | |
maybe_unused | 201603L | |
no_unique_address | 201803L | |
nodiscard | 201907L | |
noreturn | 200809L | |
unlikely | 201803L |
Macro name | Value | |
__cpp_aggregate_bases | 201603L | |
__cpp_aggregate_nsdmi | 201304L | |
__cpp_aggregate_paren_init | 201902L | |
__cpp_alias_templates | 200704L | |
__cpp_aligned_new | 201606L | |
__cpp_attributes | 200809L | |
__cpp_auto_cast | 202110L | |
__cpp_binary_literals | 201304L | |
__cpp_capture_star_this | 201603L | |
__cpp_char8_t | 202207L | |
__cpp_concepts | 202002L | |
__cpp_conditional_explicit | 201806L | |
__cpp_constexpr | 202306L | |
__cpp_constexpr_dynamic_alloc | 201907L | |
__cpp_constexpr_in_decltype | 201711L | |
__cpp_consteval | 202211L | |
__cpp_constinit | 201907L | |
__cpp_decltype | 200707L | |
__cpp_decltype_auto | 201304L | |
__cpp_deduction_guides | 201907L | |
__cpp_delegating_constructors | 200604L | |
__cpp_deleted_function | 202403L | |
__cpp_designated_initializers | 201707L | |
__cpp_enumerator_attributes | 201411L | |
__cpp_explicit_this_parameter | 202110L | |
__cpp_fold_expressions | 201603L | |
__cpp_generic_lambdas | 201707L | |
__cpp_guaranteed_copy_elision | 201606L | |
__cpp_hex_float | 201603L | |
__cpp_if_consteval | 202106L | |
__cpp_if_constexpr | 201606L | |
__cpp_impl_coroutine | 201902L | |
__cpp_impl_destroying_delete | 201806L | |
__cpp_impl_three_way_comparison | 201907L | |
__cpp_implicit_move | 202207L | |
__cpp_inheriting_constructors | 201511L | |
__cpp_init_captures | 201803L | |
__cpp_initializer_lists | 200806L | |
__cpp_inline_variables | 201606L | |
__cpp_lambdas | 200907L | |
__cpp_modules | 201907L | |
__cpp_multidimensional_subscript | 202211L | |
__cpp_named_character_escapes | 202207L | |
__cpp_namespace_attributes | 201411L | |
__cpp_noexcept_function_type | 201510L | |
__cpp_nontype_template_args | 201911L | |
__cpp_nontype_template_parameter_auto | 201606L | |
__cpp_nsdmi | 200809L | |
__cpp_pack_indexing | 202311L | |
__cpp_placeholder_variables | 202306L | |
__cpp_range_based_for | 202211L | |
__cpp_raw_strings | 200710L | |
__cpp_ref_qualifiers | 200710L | |
__cpp_return_type_deduction | 201304L | |
__cpp_rvalue_references | 200610L | |
__cpp_size_t_suffix | 202011L | |
__cpp_sized_deallocation | 201309L | |
__cpp_static_assert | 202306L | |
__cpp_static_call_operator | 202207L | |
__cpp_structured_bindings | 202403L | |
__cpp_template_template_args | 201611L | |
__cpp_threadsafe_static_init | 200806L | |
__cpp_unicode_characters | 200704L | |
__cpp_unicode_literals | 200710L | |
__cpp_user_defined_literals | 200809L | |
__cpp_using_enum | 201907L | |
__cpp_variable_templates | 201304L | |
__cpp_variadic_friend | 202403L | |
__cpp_variadic_templates | 200704L | |
__cpp_variadic_using | 201611L |
Clause | Category | |
Language support library | ||
Concepts library | ||
Diagnostics library | ||
Memory management library | ||
Metaprogramming library | ||
General utilities library | ||
Strings library | ||
Containers library | ||
Iterators library | ||
Ranges library | ||
Algorithms library | ||
Numerics library | ||
Time library | ||
Localization library | ||
Input/output library | ||
Regular expressions library | ||
Concurrency support library |
<algorithm> | <forward_list> | <mutex> | <stacktrace> | |
<any> | <fstream> | <new> | <stdexcept> | |
<array> | <functional> | <numbers> | <stdfloat> | |
<atomic> | <future> | <numeric> | <stop_token> | |
<barrier> | <generator> | <optional> | <streambuf> | |
<bit> | <hazard_pointer> | <ostream> | <string> | |
<bitset> | <initializer_list> | <print> | <string_view> | |
<charconv> | <iomanip> | <queue> | <syncstream> | |
<chrono> | <ios> | <random> | <system_error> | |
<compare> | <iosfwd> | <ranges> | <text_encoding> | |
<complex> | <iostream> | <ratio> | <thread> | |
<concepts> | <istream> | <rcu> | <tuple> | |
<condition_variable> | <iterator> | <regex> | <type_traits> | |
<coroutine> | <latch> | <scoped_allocator> | <typeindex> | |
<debugging> | <limits> | <semaphore> | <typeinfo> | |
<deque> | <linalg> | <set> | <unordered_map> | |
<exception> | <list> | <shared_mutex> | <unordered_set> | |
<execution> | <locale> | <source_location> | <utility> | |
<expected> | <map> | <span> | <valarray> | |
<filesystem> | <mdspan> | <spanstream> | <variant> | |
<flat_map> | <memory> | <sstream> | <vector> | |
<flat_set> | <memory_resource> | <stack> | <version> | |
<format> |
<cassert> | <cfenv> | <climits> | <csetjmp> | <cstddef> | <cstdlib> | <cuchar> | |
<cctype> | <cfloat> | <clocale> | <csignal> | <cstdint> | <cstring> | <cwchar> | |
<cerrno> | <cinttypes> | <cmath> | <cstdarg> | <cstdio> | <ctime> | <cwctype> |
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 |
Subclause | Header | ||
Common definitions | <cstddef> | ||
C standard library | <cstdlib> | ||
Implementation properties | <cfloat>, <climits>, <limits>, | ||
<version> | |||
Integer types | <cstdint> | ||
Dynamic memory management | <new> | ||
Type identification | <typeinfo> | ||
Source location | <source_location> | ||
Exception handling | <exception> | ||
Initializer lists | <initializer_list> | ||
Comparisons | <compare> | ||
Coroutines support | <coroutine> | ||
Other runtime support | <cstdarg> | ||
Concepts library | <concepts> | ||
Error numbers | <cerrno> | ||
System error support | <system_error> | ||
Memory | <memory> | ||
Type traits | <type_traits> | ||
Compile-time rational arithmetic | <ratio> | ||
Utility components | <utility> | ||
Tuples | <tuple> | ||
Optional objects | <optional> | ||
Variants | <variant> | ||
Expected objects | <expected> | ||
Function objects | <functional> | ||
Primitive numeric conversions | <charconv> | ||
Bit manipulation | <bit> | ||
Debugging | <debugging> | ||
String view classes | <string_view> | ||
String classes | <string> | ||
Null-terminated sequence utilities | <cstring>, <cwchar> | ||
Class template array | <array> | ||
Contiguous access | <span> | ||
Multidimensional access | <mdspan> | ||
Iterators library | <iterator> | ||
Ranges library | <ranges> | ||
Algorithms library | <algorithm>, <numeric> | ||
Mathematical functions for floating-point types | <cmath> | ||
Atomics | <atomic> | ||
Expression | Return type | Requirement | |
a == b | decltype(a == b) models boolean-testable |
Expression | Return type | Requirement | |
a < b | decltype(a < b) models boolean-testable | < is a strict weak ordering relation ([alg.sorting]) |
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 |
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 | |
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) |
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 | |
Expression | Return type | Return value | Post-condition | |
t = v | T& | t | t is equivalent to v, the value of v is unchanged |
Expression | Post-condition | |
u.~T() | All resources owned by u are reclaimed, no exception is propagated. | |
Expression | Return type | Operational semantics | |
P u(np); | Postconditions: u == nullptr | ||
P u = np; | |||
P(np) | Postconditions: P(np) == nullptr | ||
t = np | P& | Postconditions: t == nullptr | |
a != b | decltype(a != b) models boolean-testable | !(a == b) | |
a == np | a == P() | ||
np == a | |||
a != np | !(a == np) | ||
np != a |
Expression | Return type | Requirement | |
h(k) | size_t | ||
h(u) | size_t | Shall not modify u. |
Subclause | Header | ||
Common definitions | <cstddef>, <cstdlib> | ||
Implementation properties | <cfloat>, <climits>, <limits>, <version> | ||
Arithmetic types | <cstdint>, <stdfloat> | ||
Start and termination | <cstdlib> | ||
Dynamic memory management | <new> | ||
Type identification | <typeinfo> | ||
Source location | <source_location> | ||
Exception handling | <exception> | ||
Initializer lists | <initializer_list> | ||
Comparisons | <compare> | ||
Coroutines | <coroutine> | ||
Other runtime support | <csetjmp>, <csignal>, <cstdarg>, <cstdlib> |
Element | Value | |
line_ | A presumed line number ([cpp.predefined]). Line numbers are presumed to be 1-indexed;
however, an implementation is encouraged to use 0
when the line number is unknown. | |
column_ | ||
file_name_ | ||
function_name_ | A name of the current function
such as in __func__ ([dcl.fct.def.general]) if any,
an empty string otherwise. |
<assert.h> | <inttypes.h> | <signal.h> | <stdint.h> | <uchar.h> | |
<stdio.h> | <wchar.h> | ||||
<ctype.h> | <limits.h> | <stdarg.h> | <stdlib.h> | <wctype.h> | |
<errno.h> | <locale.h> | <string.h> | |||
<fenv.h> | <math.h> | ||||
<float.h> | <setjmp.h> | <stddef.h> | <time.h> |
Subclause | Header | ||
Equality preservation | |||
Language-related concepts | <concepts> | ||
Comparison concepts | |||
Object concepts | |||
Callable concepts |
Subclause | Header | ||
Exception classes | <stdexcept> | ||
Assertions | <cassert> | ||
Error numbers | <cerrno> | ||
System error support | <system_error> | ||
Stacktrace | <stacktrace> |
Subclause | Header | ||
Memory | <cstdlib>, <memory> | ||
Smart pointers | <memory> | ||
Memory resources | <memory_resource> | ||
Scoped allocators | <scoped_allocator> |
Subclause | Header | ||
Integer sequences | <utility> | ||
Type traits | <type_traits> | ||
Rational arithmetic | <ratio> |
Template | Condition | Comments | |
T is void | |||
T is an integral type ([basic.fundamental]) | |||
T is a floating-point type ([basic.fundamental]) | |||
T is an array type ([basic.compound]) of known or unknown extent | |||
T is a pointer type ([basic.compound]) | Includes pointers to functions
but not pointers to non-static members. | ||
T is an lvalue reference type ([dcl.ref]) | |||
T is an rvalue reference type ([dcl.ref]) | |||
T is a pointer to data member | |||
T is a pointer to member function | |||
T is an enumeration type ([basic.compound]) | |||
T is a union type ([basic.compound]) | |||
T is a non-union class type ([basic.compound]) | |||
T is a function type ([basic.compound]) |
Template | Condition | Comments | |
T is an lvalue reference or an rvalue reference | |||
T is an arithmetic type ([basic.fundamental]) | |||
T is a fundamental type ([basic.fundamental]) | |||
T is an object type ([basic.types.general]) | |||
T is a scalar type ([basic.types.general]) | |||
T is a compound type ([basic.compound]) | |||
T is a pointer-to-member type ([basic.compound]) |
Template | Condition | Preconditions | |
T is const-qualified ([basic.type.qualifier]) | |||
T is volatile-qualified ([basic.type.qualifier]) | |||
T is a trivial type ([basic.types.general]) | |||
T is a trivially copyable type ([basic.types.general]) | |||
T is a standard-layout type ([basic.types.general]) | |||
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. | |||
T is a polymorphic class ([class.virtual]) | |||
T is an abstract class ([class.abstract]) | |||
T is an aggregate type ([dcl.init.aggr]) | |||
If is_arithmetic_v<T> is true, the same result as
T(-1) < T(0);
otherwise, false | |||
If is_arithmetic_v<T> is true, the same result as
T(0) < T(-1);
otherwise, false | |||
T is an array type of known bound ([dcl.array]) | |||
T is an array type of unknown bound ([dcl.array]) | |||
T is a scoped enumeration ([dcl.enum]) | |||
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. | ||
For a referenceable type T ([defns.referenceable]), the same result as
is_constructible_v<T, const T&>, otherwise false. | |||
The expression declval<T>() = declval<U>() is well-formed
when treated as an unevaluated
operand ([expr.context]). Only the validity of the immediate context
of the assignment expression is considered. [Note 3: 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] | |||
The expressions swap(declval<T>(), declval<U>()) and
swap(declval<U>(), declval<T>()) are each well-formed
when treated as an unevaluated operand ([expr.context])
in an overload-resolution context
for swappable values ([swappable.requirements]). Only the validity of the immediate context
of the swap expressions is considered. [Note 4: 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] | |||
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 ([expr.context]),
where U is
remove_all_extents_t<T>. | |||
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.general], [special]). | T and all types in the template parameter pack Args shall be complete types,
cv void, or arrays of unknown bound. | ||
For a referenceable type T, the same result as
is_trivially_constructible_v<T, const T&>, otherwise false. | |||
For a referenceable type T, the same result as
is_trivially_constructible_v<T, T&&>, otherwise false. | |||
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.general], [special]). | |||
For a referenceable type T, the same result as
is_trivially_assignable_v<T&, const T&>, otherwise false. | |||
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. | |||
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. | ||
For a referenceable type T, the same result as
is_nothrow_constructible_v<T, const T&>, otherwise false. | |||
is_assignable_v<T, U> is true and the assignment is known not to
throw any exceptions ([expr.unary.noexcept]). | |||
For a referenceable type T, the same result as
is_nothrow_assignable_v<T&, const T&>, otherwise false. | |||
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]). | |||
For a referenceable type T,
the same result as is_nothrow_swappable_with_v<T&, T&>,
otherwise false. | |||
is_destructible_v<T> is true and the indicated destructor is known
not to throw any exceptions ([expr.unary.noexcept]). | |||
T has a virtual destructor ([class.dtor]) | |||
For an array type T, the same result as
has_unique_object_representations_v<remove_all_extents_t<T>>,
otherwise see below. | |||
T is a reference type, and
the initialization T t(VAL<U>); is
well-formed and binds t to
a temporary object whose lifetime is extended ([class.temporary]). Only the validity of the immediate context of
the variable initialization is considered. [Note 5: The initialization can result in effects such as
the instantiation of class template specializations and
function template specializations,
the generation of implicitly-defined functions, and so on. Such effects are not in the “immediate context” and
can result in the program being ill-formed. — end note] | |||
T is a reference type, and
the initialization T t = VAL<U>;
is well-formed and binds t to
a temporary object whose lifetime is extended ([class.temporary]). Only the validity of the immediate context of
the variable initialization is considered. [Note 6: The initialization can result in effects such as
the instantiation of class template specializations and
function template specializations,
the generation of implicitly-defined functions, and so on. Such effects are not in the “immediate context” and
can result in the program being ill-formed. — end note] |
Template | Value | |
alignof(T). | ||
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 dimension of
T, where indexing of I is zero-based |
Template | Condition | Comments | |
template<class T, class U> struct is_same; | T and U name the same type with the same cv-qualifications | ||
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 | |||
see below | |||
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]) | |||
Derived is unambiguously derived from Base
without regard to cv-qualifiers,
and each object of type Derived
is pointer-interconvertible ([basic.compound]) with
its Base subobject,
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. | ||
The expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) ([func.require])
is well-formed when treated as an unevaluated operand ([expr.context]) | Fn and all types in the template parameter pack ArgTypes
shall be complete types, cv void, or
arrays of unknown bound. | ||
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. | ||
is_invocable_v< Fn, ArgTypes...> is true and the expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) is known not to throw any exceptions ([expr.unary.noexcept]) | Fn and all types in the template parameter pack ArgTypes
shall be complete types, cv void, or
arrays of unknown bound. | ||
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 ([expr.unary.noexcept]) | Fn, R, and all types in the template parameter pack ArgTypes
shall be complete types, cv void, or
arrays of unknown bound. |
Template | Comments | |
If T is a reference, function, or top-level const-qualified
type, then type denotes T, otherwise
T const. | ||
If T is a reference, function, or top-level volatile-qualified
type, then type denotes T, otherwise
T volatile. | ||
Template | Comments | |
If T is a referenceable type ([defns.referenceable]) then
the member typedef type denotes T&;
otherwise, type denotes T. | ||
Template | Comments | |
If T is a (possibly cv-qualified) signed integer
type ([basic.fundamental]) then the member typedef
type denotes T; otherwise,
if T is a (possibly cv-qualified) unsigned integer
type then type denotes the corresponding
signed integer type, with the same cv-qualifiers as T;
otherwise, type denotes the signed integer type with smallest
rank ([conv.rank]) for which
sizeof(T) == sizeof(type), with the same
cv-qualifiers as T. | ||
If T is a (possibly cv-qualified) unsigned integer
type ([basic.fundamental]) then the member typedef
type denotes T; otherwise,
if T is a (possibly cv-qualified) signed integer
type then type denotes the corresponding
unsigned integer type, with the same cv-qualifiers as T;
otherwise, type denotes the unsigned integer type with smallest
rank ([conv.rank]) for which
sizeof(T) == sizeof(type), with the same
cv-qualifiers as T. |
Template | Comments | |
If T has type “(possibly cv-qualified) pointer
to T1” then the member typedef type
denotes T1; otherwise, it denotes T. | ||
If T is a referenceable type ([defns.referenceable]) or a
cv void type then
the member typedef type denotes
remove_reference_t<T>*;
otherwise, type denotes T. |
Template | Comments | |
[Note 1: 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,
class F> struct conditional; | ||
template<class... T> struct common_type; | ||
Unless this trait is specialized (as specified in Note D, below),
there shall be no member type. | ||
If T is an enumeration type, the member typedef type denotes
the underlying type of T ([dcl.enum]);
otherwise, there is no member type. | ||
If the expression INVOKE(declval<Fn>(), declval<ArgTypes>()...) ([func.require])
is well-formed when treated as an unevaluated operand ([expr.context]),
the member typedef type denotes the type
decltype(INVOKE(declval<Fn>(), declval<ArgTypes>()...));
otherwise, there shall be no member type. Only the validity of the immediate context of the
expression is considered. [Note 2: 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]
Preconditions: Fn and all types in the template parameter pack ArgTypes
are complete types, cv void, or arrays of
unknown bound. | ||
If T is
a specialization reference_wrapper<X> for some type X,
the member typedef type of unwrap_reference<T>
denotes X&,
otherwise type denotes T. | ||
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 |
Subclause | Header | ||
Utility components | <utility> | ||
Pairs | |||
Tuples | <tuple> | ||
Optional objects | <optional> | ||
Variants | <variant> | ||
Storage for any type | <any> | ||
Expected objects | <expected> | ||
Fixed-size sequences of bits | <bitset> | ||
Function objects | <functional> | ||
Type indexes | <typeindex> | ||
Execution policies | <execution> | ||
Primitive numeric conversions | <charconv> | ||
Formatting | <format> | ||
Bit manipulation | <bit> | ||
Debugging | <debugging> |
*this contains a value | *this does not contain a value | |||
rhs contains a value | assigns *rhs to the contained value | direct-non-list-initializes the contained value with *rhs | ||
rhs does not contain a value | destroys the contained value by calling val->T::~T() | no effect |
*this contains a value | *this does not contain a value | |||
rhs contains a value | assigns std::move(*rhs) to the contained value | direct-non-list-initializes the contained value with std::move(*rhs) | ||
rhs does not contain a value | destroys the contained value by calling val->T::~T() | no effect |
*this contains a value | *this does not contain a value | |||
rhs contains a value | assigns *rhs to the contained value | direct-non-list-initializes the contained value with *rhs | ||
rhs does not contain a value | destroys the contained value by calling val->T::~T() | no effect |
*this contains a value | *this does not contain a value | |||
rhs contains a value | assigns std::move(*rhs) to the contained value | direct-non-list-initializes the contained value with std::move(*rhs) | ||
rhs does not contain a value | destroys the contained value by calling val->T::~T() | no effect |
*this contains a value | *this does not contain a value | |||
rhs contains a value | calls swap(*(*this), *rhs) | direct-non-list-initializes the contained value of *this
with 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 | direct-non-list-initializes the contained value of rhs
with std::move(*(*this)),
followed by val->T::~T();
postcondition is that *this does not contain a value and rhs contains a value | no effect |
this->has_value() | !this->has_value() | ||
rhs.has_value() | equivalent to: using std::swap; swap(val, rhs.val); | calls rhs.swap(*this) | |
!rhs.has_value() | see below | equivalent to: using std::swap; swap(unex, rhs.unex); |
this->has_value() | !this->has_value() | ||
rhs.has_value() | no effects | calls rhs.swap(*this) | |
!rhs.has_value() | see below | equivalent to: using std::swap; swap(unex, rhs.unex); |
Option | Meaning | |
< | ||
> | ||
^ | Forces the formatted argument to be centered within the field
by inserting
fill characters before and
fill characters after the formatted argument, where
n is the padding width. |
Option | Meaning | |
+ | ||
- | Indicates that a sign should be used for
negative numbers and negative zero only (this is the default behavior). | |
space | Indicates that a leading space should be used for
non-negative numbers other than negative zero, and
a minus sign for negative numbers and negative zero. |
Type | Meaning | |
none, s | Copies the string to the output. | |
? | Copies the escaped string ([format.string.escaped]) to the output. |
Type | Meaning | |
b | ||
B | ||
c | ||
d | to_chars(first, last, value). | |
o | ||
x | ||
X | ||
none |
Type | Meaning | |
none, c | Copies the character to the output. | |
b, B, d, o, x, X | ||
? | Copies the escaped character ([format.string.escaped]) to the output. |
Type | Meaning | |
a | If precision is specified, equivalent to
to_chars(first, last, value, chars_format::hex, precision)
where precision is the specified formatting precision; equivalent to
to_chars(first, last, value, chars_format::hex)
otherwise. | |
A | The same as a, except that
it uses uppercase letters for digits above 9 and
P to indicate the exponent. | |
e | Equivalent to
to_chars(first, last, value, chars_format::scientific, precision)
where precision is the specified formatting precision,
or 6 if precision is not specified. | |
E | ||
f, F | Equivalent to
to_chars(first, last, value, chars_format::fixed, precision)
where precision is the specified formatting precision,
or 6 if precision is not specified. | |
g | Equivalent to
to_chars(first, last, value, chars_format::general, precision)
where precision is the specified formatting precision,
or 6 if precision is not specified. | |
G | ||
none | If precision is specified, equivalent to
to_chars(first, last, value, chars_format::general, precision)
where precision is the specified formatting precision; equivalent to
to_chars(first, last, value)
otherwise. |
Type | Meaning | |
none, p | If uintptr_t is defined,
to_chars(first, last, reinterpret_cast<uintptr_t>(value), 16)
with the prefix 0x inserted immediately before the output of to_chars;
otherwise, implementation-defined. | |
P |
Expression | Return type | Requirement | |
g.parse(pc) | PC::iterator | Parses format-spec ([format.string])
for type T
in the range [pc.begin(), pc.end())
until the first unmatched character.
Stores the parsed format specifiers in *this and
returns an iterator past the end of the parsed range. | |
f.format(u, fc) | FC::iterator | Formats u according to the specifiers stored in *this,
writes the output to fc.out(), and
returns an iterator past the end of the output range. The output shall only depend on
u,
fc.locale(),
fc.arg(n) for any value n of type size_t,
and the range [pc.begin(), pc.end())
from the last call to f.parse(pc). |
Expression | Return type | Requirement | |
f.format(t, fc) | FC::iterator | Formats t according to the specifiers stored in *this,
writes the output to fc.out(), and
returns an iterator past the end of the output range. The output shall only depend on
t,
fc.locale(),
fc.arg(n) for any value n of type size_t,
and the range [pc.begin(), pc.end())
from the last call to f.parse(pc). | |
f.format(u, fc) | FC::iterator | As above, but does not modify u. |
Character | Escape sequence | |
U+0009 character tabulation | \t | |
U+000a line feed | \n | |
U+000d carriage return | \r | |
U+0022 quotation mark | \" | |
U+005c reverse solidus | \\ |
Option | Requirements | Meaning | |
m | T shall be
either a specialization of pair or a specialization of tuple
such that tuple_size_v<T> is 2. | Indicates that
the opening bracket should be "{",
the closing bracket should be "}",
the separator should be ", ", and
each range element should be formatted as if
m were specified for its tuple-type. | |
s | Indicates that the range should be formatted as a string. | ||
?s | Indicates that the range should be formatted as
an escaped string ([format.string.escaped]). |
Option | Requirements | Meaning | |
m | sizeof...(Ts) == 2 | Equivalent to:
set_separator(STATICALLY-WIDEN<charT>(": "));
set_brackets({}, {});
| |
n | none | Equivalent to: set_brackets({}, {}); | |
none | none | No effects |
Subclause | Header | ||
Character traits | <string> | ||
String view classes | <string_view> | ||
String classes | <string> | ||
Null-terminated sequence utilities | <cctype>, <cstdlib>, <cstring>,
<cuchar>, <cwchar>, <cwctype> |
Expression | Return type | Assertion/note | Complexity | |
pre-/post-condition | ||||
X::char_type | C | compile-time | ||
X::int_type | (described in [char.traits.typedefs]) | compile-time | ||
X::off_type | (described in [iostreams.limits.pos] and [iostream.forward]) | compile-time | ||
X::pos_type | (described in [iostreams.limits.pos] and [iostream.forward]) | compile-time | ||
X::state_type | (described in [char.traits.typedefs]) | compile-time | ||
X::eq(c,d) | bool | constant | ||
X::lt(c,d) | bool | 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 | linear | ||
X::find(p,n,c) | const X::char_type* | linear | ||
X::move(s,p,n) | X::char_type* | linear | ||
X::copy(s,p,n) | X::char_type* | linear | ||
X::assign(r,d) | (not used) | assigns r=d. | constant | |
X::assign(s,n,c) | X::char_type* | 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 | 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 | constant |
Condition | Return Value | |
size() < str.size() | < 0 | |
size() == str.size() | 0 | |
size() > str.size() | > 0 |
Subclause | Header | ||
Requirements | |||
Sequence containers | <array>, <deque>, <forward_list>,
<list>, <vector> | ||
Associative containers | <map>, <set> | ||
Unordered associative containers | <unordered_map>, <unordered_set> | ||
Container adaptors | <queue>, <stack>, <flat_map>, <flat_set> | ||
Views | <span>, <mdspan> |
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> |
Subclause | Header | ||
Iterator requirements | <iterator> | ||
Iterator primitives | |||
Iterator adaptors | |||
Stream iterators | |||
Range access |
Contiguous | → Random Access | → Bidirectional | → Forward | → Input | |
→ Output |
Expression | Return type | Operational | Assertion/note | |
semantics | pre-/post-condition | |||
*r | unspecified | Preconditions: r is dereferenceable. | ||
++r | X& |
Expression | Return type | Operational | Assertion/note | |
semantics | pre-/post-condition | |||
a != b | decltype(a != b) models boolean-testable | !(a == b) | ||
*a | reference, convertible to T | |||
a->m | (*a).m | Preconditions: a is dereferenceable. | ||
++r | X& | |||
(void)r++ | equivalent to (void)++r | |||
*r++ | convertible to T | { T tmp = *r; ++r; return tmp; } |
Expression | Return type | Operational | Assertion/note | |
semantics | pre-/post-condition | |||
*r = o | result is not used | |||
++r | X& | |||
r++ | convertible to const X& | { X tmp = r; ++r; return tmp; } | ||
*r++ = o | result is not used |
Expression | Return type | Operational | Assertion/note | |
semantics | pre-/post-condition | |||
r++ | convertible to const X& | { X tmp = r; ++r; return tmp; } | ||
*r++ | reference |
Expression | Return type | Operational | Assertion/note | |
semantics | pre-/post-condition | |||
--r | X& | |||
r-- | convertible to const X& | { X tmp = r; --r; return tmp; } | ||
*r-- | reference |
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; | ||
a - n | X | { X tmp = a; return tmp -= n; } | ||
b - a | difference_type | return n; | ||
a[n] | convertible to reference | *(a + n) | ||
a < b | decltype(a < b) models boolean-testable | Effects: Equivalent to: return b - a > 0; | < is a total ordering relation | |
a > b | decltype(a > b) models boolean-testable | b < a | ||
a >= b | decltype(a >= b) models boolean-testable | !(a < b) | ||
a <= b | decltype(a <= b) models boolean-testable | !(a > b) |
Subclause | Header | ||
Range access | <ranges> | ||
Requirements | |||
Range utilities | |||
Range factories | |||
Range adaptors | |||
Range generators |
Subclause | Header | ||
Algorithms requirements | |||
Parallel algorithms | |||
Algorithm result types | <algorithm> | ||
Non-modifying sequence operations | |||
Mutating sequence operations | |||
Sorting and related operations | |||
Generalized numeric operations | <numeric> | ||
Specialized <memory> algorithms | <memory> | ||
Specialized <random> algorithms | <random> | ||
C library algorithms | <cstdlib> |
Subclause | Header | ||
Requirements | |||
Floating-point environment | <cfenv> | ||
Complex numbers | <complex> | ||
Random number generation | <random> | ||
Numeric arrays | <valarray> | ||
Mathematical functions for floating-point types | <cmath>, <cstdlib> | ||
Numbers | <numbers> | ||
Linear algebra | <linalg> |
Expression | Return type | Pre/post-condition | Complexity | |
S::result_type | T | 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 [ib,ie). | |||
S(il) | Same as S(il.begin(), il.end()). | same as S(il.begin(), il.end()) | ||
q.generate(rb,re) | void | |||
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. |
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)221 | Creates an engine
with an initial state
that depends on a sequence
produced by one call
to q.generate. | same as complexity of q.generate
called on a sequence
whose length is size of state | ||
e.seed() | void | Postconditions: e == E(). | same as E() | |
e.seed(s) | void | Postconditions: e == E(s). | same as E(s) | |
e.seed(q) | void | Postconditions: e == E(q). | same as E(q) | |
e() | T | per [rand.req.urng] | ||
e.discard(z)222 | void | no worse than the complexity
of z consecutive calls e() | ||
x == y | bool | |||
x != y | bool | !(x == y). | ||
os << x | reference to the type of os | With os.fmtflags set to
ios_base::dec|ios_base::left
and the fill character set to the space character,
writes to os
the textual representation
of x's current state. In the output,
adjacent numbers are separated
by one or more space characters. Postconditions: The os.fmtflags and fill character are unchanged. | ||
is >> v | reference to the type of is | With is.fmtflags
set to ios_base::dec,
sets v's state
as determined by reading its textual representation from is. If bad input is encountered,
ensures that v's state is unchanged by the operation
and
calls is.setstate(ios_base::failbit)
(which may throw ios_base::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. Preconditions: is provides a textual representation
that was previously written
using an output stream
whose imbued locale
was the same as that of is,
and whose type's template specialization arguments
charT and traits
were respectively the same as those of is. Postconditions: The is.fmtflags are unchanged. |
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 | constant | ||
x.param() | P | no worse than the complexity of D(p) | ||
d.param(p) | void | Postconditions: d.param() == p. | no worse than the complexity of D(p) | |
d(g) | T | With ,
the sequence of numbers
returned by successive invocations
with the same object g
is randomly distributed
according to the associated
p(z |{p})
or
function. | amortized constant number of invocations of g | |
d(g,p) | T | The sequence of numbers
returned by successive invocations
with the same objects g and p
is randomly distributed
according to the associated
p(z |{p})
or
function. | amortized constant number of invocations of g | |
x.min() | T | Returns glb. | constant | |
x.max() | T | Returns lub. | constant | |
x == y | bool | constant | ||
x != y | bool | !(x == y). | same as x == y. | |
os << x | reference to the type of os | Postconditions: The os.fmtflags and fill character are unchanged. | ||
is >> d | reference to the type of is | If bad input is encountered,
ensures that d is unchanged by the operation
and
calls is.setstate(ios_base::failbit)
(which may throw ios_base::failure ([iostate.flags])). Preconditions: is provides a textual representation
that was previously written
using an os whose imbued locale
and whose type's template specialization arguments
charT and traits
were the same as those of is. Postconditions: The is.fmtflags are unchanged. |
Subclause | Header | ||
Cpp17Clock requirements | |||
Time-related traits | <chrono> | ||
Class template duration | |||
Class template time_point | |||
Clocks | |||
Civil calendar | |||
Class template hh_mm_ss | |||
12/24 hour functions | |||
Time zones | |||
Formatting | |||
Parsing | |||
Hash support | |||
C library time utilities | <ctime> |
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> | ||
C1::is_steady | const bool | ||
C1::now() | C1::time_point | Returns a time_point object representing the current point in time. |
Duration | fractional_width | Formatted fractional second output | |
hours, minutes, and seconds | 0 | ||
milliseconds | 3 | 0.001 | |
microseconds | 6 | 0.000001 | |
nanoseconds | 9 | 0.000000001 | |
duration<int, ratio<1, 2>> | 1 | 0.5 | |
duration<int, ratio<1, 3>> | 6 | 0.333333 | |
duration<int, ratio<1, 4>> | 2 | 0.25 | |
duration<int, ratio<1, 5>> | 1 | 0.2 | |
duration<int, ratio<1, 6>> | 6 | 0.166666 | |
duration<int, ratio<1, 7>> | 6 | 0.142857 | |
duration<int, ratio<1, 8>> | 3 | 0.125 | |
duration<int, ratio<1, 9>> | 6 | 0.111111 | |
duration<int, ratio<1, 10>> | 1 | 0.1 | |
duration<int, ratio<756, 625>> | 4 | 0.2096 |
Specifier | Replacement | |
%a | ||
%A | ||
%b | ||
%B | ||
%c | ||
%C | ||
%d | ||
%D | Equivalent to %m/%d/%y. | |
%e | ||
%F | Equivalent to %Y-%m-%d. | |
%g | ||
%G | ||
%h | Equivalent to %b. | |
%H | ||
%I | ||
%j | ||
%m | ||
%M | ||
%n | A new-line character. | |
%p | The locale's equivalent of the AM/PM designations associated with a 12-hour clock. | |
%q | The duration's unit suffix as specified in [time.duration.io]. | |
%Q | The duration's numeric value (as if extracted via .count()). | |
%r | The locale's 12-hour clock time. | |
%R | Equivalent to %H:%M. | |
%S | Seconds as a decimal number. 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 | ||
%U | ||
%V | ||
%w | ||
%W | ||
%x | ||
%X | ||
%y | ||
%Y | ||
%z | ||
%Z | ||
%% | A % character. |
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 | ||
%C | ||
%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 %Od interprets
the locale's alternative representation of the day of the month. | |
%D | Equivalent to %m/%d/%y. | |
%e | ||
%F | ||
%g | ||
%G | ||
%h | Equivalent to %b. | |
%H | ||
%I | ||
%j | ||
%m | ||
%M | ||
%n | ||
%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 | 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 whitespace characters. | |
%T | Equivalent to %H:%M:%S. | |
%u | ||
%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. The modified command %OU interprets
the locale's alternative representation. | |
%V | ||
%w | ||
%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. The modified command %OW interprets
the locale's alternative representation. | |
%x | ||
%X | ||
%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. | |
%Y | ||
%z | ||
%Z | The time zone abbreviation or name. A single word is parsed. This word can only contain characters
from the basic character set ([lex.charset])
that are alphanumeric, or one of
'_', '/', '-', or '+'. | |
%% | A % character is extracted. |
Subclause | Header | ||
Locales | <locale> | ||
Standard locale categories | |||
C library locales | <clocale> | ||
Text encodings identification | <text_encoding> |
Category | Includes facets | |
collate | collate<char>, collate<wchar_t> | |
ctype | ctype<char>, ctype<wchar_t> | |
codecvt<char, 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> |
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<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> |
Value | Meaning | |
ok | completed the conversion | |
partial | not all source characters converted | |
error | encountered a character in [from, from_end)
that cannot be converted | |
noconv | internT and externT are the same type, and input
sequence is identical to converted sequence |
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 |
State | stdio equivalent | |
basefield == oct | %o | |
basefield == hex | %X | |
basefield == 0 | %i | |
signed integral type | %d | |
unsigned integral type | %u |
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 |
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 |
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 |
Type | Length modifier | |
long | l | |
long long | ll | |
unsigned long | l | |
unsigned long long | ll | |
long double | L | |
otherwise | none |
Type(s) | State | stdio equivalent | |
an integral type | showpos | + | |
showbase | # | ||
a floating-point type | showpos | + | |
showpoint | # |
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 |
date_order() | Format | |
no_order | "%m%d%y" | |
dmy | "%d%m%y" | |
mdy | "%m%d%y" | |
ymd | "%y%m%d" | |
ydm | "%y%d%m" |
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 |
Subclause | Header | ||
Requirements | |||
Forward declarations | <iosfwd> | ||
Standard iostream objects | <iostream> | ||
Iostreams base classes | <ios> | ||
Stream buffers | <streambuf> | ||
Formatting and manipulators | <istream>, <ostream>, <iomanip>, <print> | ||
String streams | <sstream> | ||
Span-based streams | <spanstream> | ||
File streams | <fstream> | ||
Synchronized output streams | <syncstream> | ||
File systems | <filesystem> | ||
C library files | <cstdio>, <cinttypes> |
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 |
Constant | Allowable values | |
adjustfield | left | right | internal | |
basefield | dec | oct | hex | |
floatfield | scientific | fixed |
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. |
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 | |
noreplace | open in exclusive mode | |
out | open for output | |
trunc | truncate an existing stream when opening |
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 |
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; | ||||
P() | P | P(0) | ||
P p; | P p(0); | |||
O(p) | streamoff | converts to offset | P(O(p)) == p | |
p == q | bool | Remarks: For any two values o and o2,
if p is obtained
from o converted to P or
from a copy of such P value and
if q is obtained
from o2 converted to P or
from a copy of such P value,
then p == q is true
only if o == o2 is true. | ||
p != q | 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) |
Element | Value | |
rdbuf() | sb | |
tie() | 0 | |
rdstate() | ||
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 |
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() |
Conditions | Result | |
ios_base::in is set in which | positions the input sequence | |
ios_base::out is set in which | positions the output sequence | |
both ios_base::in and ios_base::out are
set in which and either way == ios_base::beg or way == ios_base::end | positions both the input and the output sequences | |
Otherwise | the positioning operation fails. |
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). |
ios_base flag combination | stdio equivalent | ||||||
binary | in | out | trunc | app | noreplace | ||
+ | "w" | ||||||
+ | + | "wx" | |||||
+ | + | "w" | |||||
+ | + | + | "wx" | ||||
+ | + | "a" | |||||
+ | "a" | ||||||
+ | "r" | ||||||
+ | + | "r+" | |||||
+ | + | + | "w+" | ||||
+ | + | + | + | "w+x" | |||
+ | + | + | "a+" | ||||
+ | + | "a+" | |||||
+ | + | "wb" | |||||
+ | + | + | "wbx" | ||||
+ | + | + | "wb" | ||||
+ | + | + | + | "wbx" | |||
+ | + | + | "ab" | ||||
+ | + | "ab" | |||||
+ | + | "rb" | |||||
+ | + | + | "r+b" | ||||
+ | + | + | + | "w+b" | |||
+ | + | + | + | + | "w+bx" | ||
+ | + | + | + | "a+b" | |||
+ | + | + | "a+b" |
way Value | stdio Equivalent | |
basic_ios::beg | SEEK_SET | |
basic_ios::cur | SEEK_CUR | |
basic_ios::end | SEEK_END |
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. Recommended practice: For POSIX-based systems, native and generic formats are equivalent
and the character sequence should always be interpreted in the same way. |
Constant | Meaning | |
none | The type of the file has not been determined or an error occurred while
trying to determine the type. | |
not_found | ||
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 | |
unknown | The file exists but the type cannot be determined |
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 subdirectories | ||
Constant | Meaning | |
none | (Default) Do not copy subdirectories. | |
recursive | Recursively copy subdirectories 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 | ||
create_hard_links | Make hard links instead of copies of files. |
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 |
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. |
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. |
Subclause | Header | ||
Requirements | |||
Constants | <regex> | ||
Exception type | |||
Traits | |||
Regular expression template | |||
Submatches | |||
Match results | |||
Algorithms | |||
Iterators | |||
Grammar |
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 | ||
collate | ||
ECMAScript | Specifies that the grammar recognized by the regular expression engine
shall be that used by ECMAScript in ECMA-262, as modified in [re.grammar]. | |
basic | Specifies that the grammar recognized by the regular expression engine
shall be that used by basic regular expressions in POSIX. 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 | ||
grep | ||
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. |
Element | Effect(s) if set | |
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). | ||
The last character in the sequence [first, last) shall be treated
as though it is not at the end of a line, so the character
"$" in the regular expression shall not match [last, last). | ||
If more than one match is possible then any match is an
acceptable result. | ||
The expression shall not match an empty
sequence. | ||
The expression shall only match a sub-sequence that begins at
first. | ||
--first is a valid iterator position.When this flag is
set the flags match_not_bol and match_not_bow shall be ignored by the
regular expression algorithms and iterators. | ||
When a regular expression match is to be replaced by a
new string, the new string shall be constructed using the rules used by
the ECMAScript replace function in ECMA-262,
part 15.5.4.11 String.prototype.replace. In
addition, during search and replace operations all non-overlapping
occurrences of the regular expression shall be located and replaced, and
sections of the input that did not match the expression shall be copied
unchanged to the output string. | ||
During a search and replace operation, sections of
the character container sequence being searched that do not match the
regular expression shall not be copied to the output string. | ||
When specified during a search and replace operation, only the
first occurrence of the regular expression shall be replaced. |
Value | Error condition | |
error_collate | The expression contains an invalid collating element name. | |
error_ctype | The expression contains an invalid character class name. | |
error_escape | The expression contains an invalid escaped character, or a trailing
escape. | |
error_backref | The expression contains an invalid back reference. | |
error_brack | ||
error_paren | ||
error_brace | The expression contains mismatched { and } | |
error_badbrace | The expression contains an invalid range in a {} expression. | |
error_range | The expression contains an invalid character range, such as
[b-a] in most encodings. | |
error_space | There is insufficient memory to convert the expression into a finite
state machine. | |
error_badrepeat | One of *?+{ is not preceded by a valid regular expression. | |
error_complexity | The complexity of an attempted match against a regular expression
exceeds a pre-set level. | |
error_stack | There is insufficient memory to determine whether the regular
expression matches the specified character sequence. |
Narrow character name | Wide character name | Corresponding ctype_base::mask value | |
"alnum" | L"alnum" | ctype_base::alnum | |
"alpha" | L"alpha" | ctype_base::alpha | |
"blank" | L"blank" | ctype_base::blank | |
"cntrl" | L"cntrl" | ctype_base::cntrl | |
"digit" | L"digit" | ctype_base::digit | |
"d" | L"d" | ctype_base::digit | |
"graph" | L"graph" | ctype_base::graph | |
"lower" | L"lower" | ctype_base::lower | |
"print" | L"print" | ctype_base::print | |
"punct" | L"punct" | ctype_base::punct | |
"space" | L"space" | ctype_base::space | |
"s" | L"s" | ctype_base::space | |
"upper" | L"upper" | ctype_base::upper | |
"w" | L"w" | ctype_base::alnum | |
"xdigit" | L"xdigit" | ctype_base::xdigit |
Element | Value | |
ready() | m.ready() | |
size() | m.size() | |
str(n) | m.str(n) for all non-negative integers n < m.size() | |
prefix() | m.prefix() | |
suffix() | m.suffix() | |
(*this)[n] | m[n] for all non-negative integers n < m.size() | |
length(n) | m.length(n) for all non-negative integers n < m.size() | |
position(n) | m.position(n) for all non-negative integers n < m.size() |
Element | Value | |
m.size() | 1 + e.mark_count() | |
m.empty() | false | |
m.prefix().first | first | |
m.prefix().second | first | |
m.prefix().matched | false | |
m.suffix().first | last | |
m.suffix().second | last | |
m.suffix().matched | false | |
m[0].first | first | |
m[0].second | last | |
m[0].matched | true | |
m[n].first | ||
m[n].second | ||
m[n].matched | For all integers 0 < n < m.size(), true if sub-expression n participated in
the match, false otherwise. |
Element | Value | |
m.size() | 1 + e.mark_count() | |
m.empty() | false | |
m.prefix().first | first | |
m.prefix().second | m[0].first | |
m.prefix().matched | m.prefix().first != m.prefix().second | |
m.suffix().first | m[0].second | |
m.suffix().second | last | |
m.suffix().matched | m.suffix().first != m.suffix().second | |
m[0].first | The start of the sequence of characters that matched the regular expression | |
m[0].second | The end of the sequence of characters that matched the regular expression | |
m[0].matched | true | |
m[n].first | ||
m[n].second | ||
m[n].matched | For all integers 0 < n < m.size(), true if sub-expression n
participated in the match, false otherwise. |
Subclause | Header | ||
Requirements | |||
Stop tokens | <stop_token> | ||
Threads | <thread> | ||
Atomic operations | <atomic>, <stdatomic.h> | ||
Mutual exclusion | <mutex>, <shared_mutex> | ||
Condition variables | <condition_variable> | ||
Semaphores | <semaphore> | ||
Coordination types | <latch>, <barrier> | ||
Futures | <future> | ||
Safe reclamation | <rcu>, <hazard_pointer> |
key | Op | Computation | key | Op | Computation | |
add | + | addition | and | & | bitwise and | |
sub | - | subtraction | or | | | bitwise inclusive or | |
max | maximum | xor | ^ | bitwise exclusive or | ||
min | minimum |
key | Op | Computation | key | Op | Computation | |
add | + | addition | sub | - | subtraction | |
max | maximum | min | minimum |