From Jason Turner

[type.descriptions]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9vkdvp0b/{from.md → to.md} +76 -43
tmp/tmp9vkdvp0b/{from.md → to.md} RENAMED
@@ -2,23 +2,21 @@
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.[^6] These names are used in library
7
- Clauses to describe the types that may be supplied as arguments by a
8
- C++program when instantiating template components from the library.
9
 
10
- Certain types defined in Clause  [[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 Clauses  [[language.support]] through 
17
- [[thread]] and Annex  [[depr]] that are used as function parameter or
18
- return types are defined for the purpose of exposition only in order to
19
- capture their language linkage. The declarations of such types are
20
  followed by a comment ending in *exposition only*.
21
 
22
  [*Example 1*:
23
 
24
  ``` cpp
@@ -32,73 +30,73 @@ function that takes a callback parameter with C language linkage.
32
 
33
  — *end example*]
34
 
35
  ##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
36
 
37
- Several types defined in Clause  [[input.output]] are *enumerated
38
- types*. Each enumerated type may be implemented as an enumeration or as
39
- a synonym for an enumeration.[^7]
40
 
41
  The enumerated type `enumerated` can be written:
42
 
43
  ``` cpp
44
- enum enumerated { V₀, V₁, V₂, V₃, ..... };
45
 
46
  inline const enumerated C₀(V₀);
47
  inline const enumerated C₁(V₁);
48
  inline const enumerated C₂(V₂);
49
  inline const enumerated C₃(V₃);
50
- .....
51
  ```
52
 
53
  Here, the names `C₀`, `C₁`, etc. represent *enumerated elements* for
54
  this particular enumerated type. All such elements have distinct values.
55
 
56
  ##### Bitmask types <a id="bitmask.types">[[bitmask.types]]</a>
57
 
58
- Several types defined in Clauses  [[language.support]] through 
59
- [[thread]] and Annex  [[depr]] are *bitmask types*. Each bitmask type
60
- can be implemented as an enumerated type that overloads certain
61
- operators, as an integer type, or as a `bitset` ([[template.bitset]]).
62
 
63
- The bitmask type *bitmask* can be written:
64
 
65
  ``` cpp
66
  // For exposition only.
67
  // int_type is an integral type capable of representing all values of the bitmask type.
68
  enum bitmask : int_type {
69
- V₀ = 1 << 0, V₁ = 1 << 1, V₂ = 1 << 2, V₃ = 1 << 3, .....
70
  };
71
 
72
  inline constexpr bitmask C₀(V₀{});
73
  inline constexpr bitmask C₁(V₁{});
74
  inline constexpr bitmask C₂(V₂{});
75
  inline constexpr bitmask C₃(V₃{});
76
- .....
77
 
78
- constexpr bitmask{} operator&(bitmask{} X, bitmask{} Y) {
79
- return static_cast<bitmask{}>(
80
  static_cast<int_type>(X) & static_cast<int_type>(Y));
81
  }
82
- constexpr bitmask{} operator|(bitmask{} X, bitmask{} Y) {
83
- return static_cast<bitmask{}>(
84
  static_cast<int_type>(X) | static_cast<int_type>(Y));
85
  }
86
- constexpr bitmask{} operator^(bitmask{} X, bitmask{} Y){
87
- return static_cast<bitmask{}>(
88
  static_cast<int_type>(X) ^ static_cast<int_type>(Y));
89
  }
90
- constexpr bitmask{} operator~(bitmask{} X){
91
- return static_cast<bitmask{}>(~static_cast<int_type>(X));
92
  }
93
- bitmask{}& operator&=(bitmask{}& X, bitmask{} Y){
94
  X = X & Y; return X;
95
  }
96
- bitmask{}& operator|=(bitmask{}& X, bitmask{} Y) {
97
  X = X | Y; return X;
98
  }
99
- bitmask{}& operator^=(bitmask{}& X, bitmask{} Y) {
100
  X = X ^ Y; return X;
101
  }
102
  ```
103
 
104
  Here, the names `C₀`, `C₁`, etc. represent *bitmask elements* for this
@@ -125,41 +123,76 @@ sequences that follow a few uniform conventions:
125
  basic execution character set.
126
  - The *decimal-point character* is the (single-byte) character used by
127
  functions that convert between a (single-byte) character sequence and
128
  a value of one of the floating-point types. It is used in the
129
  character sequence to denote the beginning of a fractional part. It is
130
- represented in Clauses  [[language.support]] through  [[thread]] and
131
- Annex  [[depr]] by a period, `'.'`, which is also its value in the
132
- `"C"` locale, but may change during program execution by a call to
133
  `setlocale(int, const char*)`,[^8] or by a change to a `locale`
134
- object, as described in Clauses  [[locales]] and  [[input.output]].
135
- - A *character sequence* is an array object ([[dcl.array]]) `A` that
136
- can be declared as `T A[N]`, where `T` is any of the types `char`,
137
- `unsigned char`, or `signed char` ([[basic.fundamental]]), optionally
138
  qualified by any combination of `const` or `volatile`. The initial
139
  elements of the array have defined contents up to and including an
140
  element determined by some predicate. A character sequence can be
141
  designated by a pointer value `S` that points to its first element.
142
 
143
  ###### Byte strings <a id="byte.strings">[[byte.strings]]</a>
144
 
145
  A *null-terminated byte string*, or NTBS, is a character sequence whose
146
  highest-addressed element with defined content has the value zero (the
147
- *terminating null* character); no other element in the sequence has the
148
  value zero. [^9]
149
 
150
- The *length* of an NTBS is the number of elements that precede the
151
- terminating null character. An *empty* NTBS has a length of zero.
152
 
153
- The *value* of an NTBS is the sequence of values of the elements up to
154
  and including the terminating null character.
155
 
156
- A *static* NTBS is an NTBSwith static storage duration.[^10]
157
 
158
  ###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
159
 
160
  A *null-terminated multibyte string*, or NTMBS, is an NTBS that
161
  constitutes a sequence of valid multibyte characters, beginning and
162
  ending in the initial shift state.[^11]
163
 
164
- A *static* NTMBS is an NTMBSwith static storage duration.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
 
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.[^6] These names are used in library
7
+ Clauses to describe the types that may be supplied as arguments by a C++
8
+ program when instantiating template components from the library.
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
 
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.[^7]
38
 
39
  The enumerated type `enumerated` can be written:
40
 
41
  ``` cpp
42
+ enum enumerated { V₀, V₁, V₂, V₃, };
43
 
44
  inline const enumerated C₀(V₀);
45
  inline const enumerated C₁(V₁);
46
  inline const enumerated C₂(V₂);
47
  inline const enumerated C₃(V₃);
48
+
49
  ```
50
 
51
  Here, the names `C₀`, `C₁`, etc. represent *enumerated elements* for
52
  this particular enumerated type. All such elements have distinct values.
53
 
54
  ##### Bitmask types <a id="bitmask.types">[[bitmask.types]]</a>
55
 
56
+ Several types defined in [[support]] through [[thread]] and [[depr]] are
57
+ *bitmask types*. Each bitmask type can be implemented as an enumerated
58
+ type that overloads certain operators, as an integer type, or as a
59
+ `bitset` [[template.bitset]].
60
 
61
+ The bitmask type `bitmask` can be written:
62
 
63
  ``` cpp
64
  // For exposition only.
65
  // int_type is an integral type capable of representing all values of the bitmask type.
66
  enum bitmask : int_type {
67
+ V₀ = 1 << 0, V₁ = 1 << 1, V₂ = 1 << 2, V₃ = 1 << 3,
68
  };
69
 
70
  inline constexpr bitmask C₀(V₀{});
71
  inline constexpr bitmask C₁(V₁{});
72
  inline constexpr bitmask C₂(V₂{});
73
  inline constexpr bitmask C₃(V₃{});
74
+
75
 
76
+ constexpr bitmask operator&(bitmask X, bitmask Y) {
77
+ return static_cast<bitmask>(
78
  static_cast<int_type>(X) & static_cast<int_type>(Y));
79
  }
80
+ constexpr bitmask operator|(bitmask X, bitmask Y) {
81
+ return static_cast<bitmask>(
82
  static_cast<int_type>(X) | static_cast<int_type>(Y));
83
  }
84
+ constexpr bitmask operator^(bitmask X, bitmask Y){
85
+ return static_cast<bitmask>(
86
  static_cast<int_type>(X) ^ static_cast<int_type>(Y));
87
  }
88
+ constexpr bitmask operator~(bitmask X){
89
+ return static_cast<bitmask>(~static_cast<int_type>(X));
90
  }
91
+ bitmask& operator&=(bitmask& X, bitmask Y){
92
  X = X & Y; return X;
93
  }
94
+ bitmask& operator|=(bitmask& X, bitmask Y) {
95
  X = X | Y; return X;
96
  }
97
+ bitmask& operator^=(bitmask& X, bitmask Y) {
98
  X = X ^ Y; return X;
99
  }
100
  ```
101
 
102
  Here, the names `C₀`, `C₁`, etc. represent *bitmask elements* for this
 
123
  basic execution character set.
124
  - The *decimal-point character* is the (single-byte) character used by
125
  functions that convert between a (single-byte) character sequence and
126
  a value of one of the floating-point types. It is used in the
127
  character sequence to denote the beginning of a fractional part. It is
128
+ represented in [[support]] through [[thread]] and [[depr]] by a
129
+ period, `'.'`, which is also its value in the `"C"` locale, but may
130
+ change during program execution by a call to
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
138
  element determined by some predicate. A character sequence can be
139
  designated by a pointer value `S` that points to its first element.
140
 
141
  ###### Byte strings <a id="byte.strings">[[byte.strings]]</a>
142
 
143
  A *null-terminated byte string*, or NTBS, is a character sequence whose
144
  highest-addressed element with defined content has the value zero (the
145
+ *terminating null character*); no other element in the sequence has the
146
  value zero. [^9]
147
 
148
+ The *length of an NTBS* is the number of elements that precede the
149
+ terminating null character. An *empty NTBS* has a length of zero.
150
 
151
+ The *value of an NTBS* is the sequence of values of the elements up to
152
  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.
163
+
164
+ ##### Customization Point Object types <a id="customization.point.object">[[customization.point.object]]</a>
165
+
166
+ A *customization point object* is a function object [[function.objects]]
167
+ with a literal class type that interacts with program-defined types
168
+ 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 shall model
177
+ `invocable<const T&, Args...>` [[concept.invocable]] when the types in
178
+ `Args...` meet the requirements specified in that customization point
179
+ object’s definition. When the types of `Args...` do not meet the
180
+ customization point object’s requirements, `T` shall not have a function
181
+ call operator that participates in overload resolution.
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