tmp/tmpcj9j6rtp/{from.md → to.md}
RENAMED
|
@@ -1,42 +1,25 @@
|
|
| 1 |
#### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
|
| 2 |
|
| 3 |
##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
|
| 4 |
|
| 5 |
The Requirements subclauses may describe names that are used to specify
|
| 6 |
-
constraints on template arguments.[^
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
|
| 10 |
Certain types defined in [[input.output]] are used to describe
|
| 11 |
implementation-defined types. They are based on other types, but with
|
| 12 |
added constraints.
|
| 13 |
|
| 14 |
-
##### Exposition-only types <a id="expos.only.types">[[expos.only.types]]</a>
|
| 15 |
-
|
| 16 |
-
Several types defined in [[support]] through [[thread]] and [[depr]] are
|
| 17 |
-
defined for the purpose of exposition. The declaration of such a type is
|
| 18 |
-
followed by a comment ending in *exposition only*.
|
| 19 |
-
|
| 20 |
-
[*Example 1*:
|
| 21 |
-
|
| 22 |
-
``` cpp
|
| 23 |
-
namespace std {
|
| 24 |
-
extern "C" using some-handler = int(int, void*, double); // exposition only
|
| 25 |
-
}
|
| 26 |
-
```
|
| 27 |
-
|
| 28 |
-
The type placeholder `some-handler` can now be used to specify a
|
| 29 |
-
function that takes a callback parameter with C language linkage.
|
| 30 |
-
|
| 31 |
-
— *end example*]
|
| 32 |
-
|
| 33 |
##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
|
| 34 |
|
| 35 |
Several types defined in [[input.output]] are *enumerated types*. Each
|
| 36 |
enumerated type may be implemented as an enumeration or as a synonym for
|
| 37 |
-
an enumeration.[^
|
| 38 |
|
| 39 |
The enumerated type `enumerated` can be written:
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
enum enumerated { V₀, V₁, V₂, V₃, … };
|
|
@@ -114,24 +97,36 @@ The following terms apply to objects and values of bitmask types:
|
|
| 114 |
- The value *Y* *is set* in the object *X* if the expression *X* `&` *Y*
|
| 115 |
is nonzero.
|
| 116 |
|
| 117 |
##### Character sequences <a id="character.seq">[[character.seq]]</a>
|
| 118 |
|
|
|
|
|
|
|
| 119 |
The C standard library makes widespread use of characters and character
|
| 120 |
sequences that follow a few uniform conventions:
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
- A *letter* is any of the 26 lowercase or 26 uppercase letters in the
|
| 123 |
-
basic
|
| 124 |
-
- The *decimal-point character* is the (single-byte)
|
| 125 |
-
functions that convert between a (single-byte)
|
| 126 |
-
a value of one of the floating-point types. It
|
| 127 |
-
character sequence to denote the beginning of a
|
| 128 |
-
represented in [[support]] through [[thread]]
|
| 129 |
-
period, `'.'`, which is also its value in the `"C"`
|
| 130 |
-
|
| 131 |
-
`setlocale(int, const char*)`,[^8] or by a change to a `locale`
|
| 132 |
-
object, as described in [[locales]] and [[input.output]].
|
| 133 |
- A *character sequence* is an array object [[dcl.array]] `A` that can
|
| 134 |
be declared as `T A[N]`, where `T` is any of the types `char`,
|
| 135 |
`unsigned char`, or `signed char` [[basic.fundamental]], optionally
|
| 136 |
qualified by any combination of `const` or `volatile`. The initial
|
| 137 |
elements of the array have defined contents up to and including an
|
|
@@ -153,10 +148,14 @@ and including the terminating null character.
|
|
| 153 |
|
| 154 |
A *static NTBS* is an NTBS with static storage duration.[^10]
|
| 155 |
|
| 156 |
###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
A *null-terminated multibyte string*, or NTMBS, is an NTBS that
|
| 159 |
constitutes a sequence of valid multibyte characters, beginning and
|
| 160 |
ending in the initial shift state.[^11]
|
| 161 |
|
| 162 |
A *static NTMBS* is an NTMBS with static storage duration.
|
|
@@ -169,30 +168,31 @@ while enforcing semantic requirements on that interaction.
|
|
| 169 |
|
| 170 |
The type of a customization point object, ignoring cv-qualifiers, shall
|
| 171 |
model `semiregular` [[concepts.object]].
|
| 172 |
|
| 173 |
All instances of a specific customization point object type shall be
|
| 174 |
-
equal [[concepts.equality]].
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
The type `T` of a customization point object
|
| 177 |
-
`invocable<
|
| 178 |
-
`Args...`
|
| 179 |
-
|
| 180 |
-
customization point object’s
|
| 181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
Each customization point object type constrains its return type to model
|
| 184 |
a particular concept.
|
| 185 |
|
| 186 |
-
[*Note 1*: Many of the customization point objects in the library
|
| 187 |
-
evaluate function call expressions with an unqualified name which
|
| 188 |
-
results in a call to a program-defined function found by argument
|
| 189 |
-
dependent name lookup [[basic.lookup.argdep]]. To preclude such an
|
| 190 |
-
expression resulting in a call to unconstrained functions with the same
|
| 191 |
-
name in namespace `std`, customization point objects specify that lookup
|
| 192 |
-
for these expressions is performed in a context that includes deleted
|
| 193 |
-
overloads matching the signatures of overloads defined in namespace
|
| 194 |
-
`std`. When the deleted overloads are viable, program-defined overloads
|
| 195 |
-
need be more specialized [[temp.func.order]] or more constrained
|
| 196 |
-
[[temp.constr.order]] to be used by a customization point
|
| 197 |
-
object. — *end note*]
|
| 198 |
-
|
|
|
|
| 1 |
#### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
|
| 2 |
|
| 3 |
##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
|
| 4 |
|
| 5 |
The Requirements subclauses may describe names that are used to specify
|
| 6 |
+
constraints on template arguments.[^7]
|
| 7 |
+
|
| 8 |
+
These names are used in library Clauses to describe the types that may
|
| 9 |
+
be supplied as arguments by a C++ program when instantiating template
|
| 10 |
+
components from the library.
|
| 11 |
|
| 12 |
Certain types defined in [[input.output]] are used to describe
|
| 13 |
implementation-defined types. They are based on other types, but with
|
| 14 |
added constraints.
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
|
| 17 |
|
| 18 |
Several types defined in [[input.output]] are *enumerated types*. Each
|
| 19 |
enumerated type may be implemented as an enumeration or as a synonym for
|
| 20 |
+
an enumeration.[^8]
|
| 21 |
|
| 22 |
The enumerated type `enumerated` can be written:
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
enum enumerated { V₀, V₁, V₂, V₃, … };
|
|
|
|
| 97 |
- The value *Y* *is set* in the object *X* if the expression *X* `&` *Y*
|
| 98 |
is nonzero.
|
| 99 |
|
| 100 |
##### Character sequences <a id="character.seq">[[character.seq]]</a>
|
| 101 |
|
| 102 |
+
###### General <a id="character.seq.general">[[character.seq.general]]</a>
|
| 103 |
+
|
| 104 |
The C standard library makes widespread use of characters and character
|
| 105 |
sequences that follow a few uniform conventions:
|
| 106 |
|
| 107 |
+
- Properties specified as *locale-specific* may change during program
|
| 108 |
+
execution by a call to `setlocale(int, const char*)` [[clocale.syn]],
|
| 109 |
+
or by a change to a `locale` object, as described in [[locales]] and
|
| 110 |
+
[[input.output]].
|
| 111 |
+
- The *execution character set* and the *execution wide-character set*
|
| 112 |
+
are supersets of the basic literal character set [[lex.charset]]. The
|
| 113 |
+
encodings of the execution character sets and the sets of additional
|
| 114 |
+
elements (if any) are locale-specific. Each element of the execution
|
| 115 |
+
wide-character set is encoded as a single code unit representable by a
|
| 116 |
+
value of type `wchar_t`. \[*Note 1*: The encodings of the execution
|
| 117 |
+
character sets can be unrelated to any literal
|
| 118 |
+
encoding. — *end note*]
|
| 119 |
- A *letter* is any of the 26 lowercase or 26 uppercase letters in the
|
| 120 |
+
basic character set.
|
| 121 |
+
- The *decimal-point character* is the locale-specific (single-byte)
|
| 122 |
+
character used by functions that convert between a (single-byte)
|
| 123 |
+
character sequence and a value of one of the floating-point types. It
|
| 124 |
+
is used in the character sequence to denote the beginning of a
|
| 125 |
+
fractional part. It is represented in [[support]] through [[thread]]
|
| 126 |
+
and [[depr]] by a period, `'.'`, which is also its value in the `"C"`
|
| 127 |
+
locale.
|
|
|
|
|
|
|
| 128 |
- A *character sequence* is an array object [[dcl.array]] `A` that can
|
| 129 |
be declared as `T A[N]`, where `T` is any of the types `char`,
|
| 130 |
`unsigned char`, or `signed char` [[basic.fundamental]], optionally
|
| 131 |
qualified by any combination of `const` or `volatile`. The initial
|
| 132 |
elements of the array have defined contents up to and including an
|
|
|
|
| 148 |
|
| 149 |
A *static NTBS* is an NTBS with static storage duration.[^10]
|
| 150 |
|
| 151 |
###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
|
| 152 |
|
| 153 |
+
A *multibyte character* is a sequence of one or more bytes representing
|
| 154 |
+
the code unit sequence for an encoded character of the execution
|
| 155 |
+
character set.
|
| 156 |
+
|
| 157 |
A *null-terminated multibyte string*, or NTMBS, is an NTBS that
|
| 158 |
constitutes a sequence of valid multibyte characters, beginning and
|
| 159 |
ending in the initial shift state.[^11]
|
| 160 |
|
| 161 |
A *static NTMBS* is an NTMBS with static storage duration.
|
|
|
|
| 168 |
|
| 169 |
The type of a customization point object, ignoring cv-qualifiers, shall
|
| 170 |
model `semiregular` [[concepts.object]].
|
| 171 |
|
| 172 |
All instances of a specific customization point object type shall be
|
| 173 |
+
equal [[concepts.equality]]. The effects of invoking different instances
|
| 174 |
+
of a specific customization point object type on the same arguments are
|
| 175 |
+
equivalent.
|
| 176 |
|
| 177 |
+
The type `T` of a customization point object, ignoring *cv-qualifier*s,
|
| 178 |
+
shall model `invocable<T&, Args...>`, `invocable<const T&, Args...>`,
|
| 179 |
+
`invocable<T, Args...>`, and `invocable<const T, Args...>`
|
| 180 |
+
[[concept.invocable]] when the types in `Args...` meet the requirements
|
| 181 |
+
specified in that customization point object’s definition. When the
|
| 182 |
+
types of `Args...` do not meet the customization point object’s
|
| 183 |
+
requirements, `T` shall not have a function call operator that
|
| 184 |
+
participates in overload resolution.
|
| 185 |
+
|
| 186 |
+
For a given customization point object `o`, let `p` be a variable
|
| 187 |
+
initialized as if by `auto p = o;`. Then for any sequence of arguments
|
| 188 |
+
`args...`, the following expressions have effects equivalent to
|
| 189 |
+
`o(args...)`:
|
| 190 |
+
|
| 191 |
+
- `p(args...)`
|
| 192 |
+
- `as_const(p)(args...)`
|
| 193 |
+
- `std::move(p)(args...)`
|
| 194 |
+
- `std::move(as_const(p))(args...)`
|
| 195 |
|
| 196 |
Each customization point object type constrains its return type to model
|
| 197 |
a particular concept.
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|