From Jason Turner

[support.types]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvmc1s4cc/{from.md → to.md} +50 -59
tmp/tmpvmc1s4cc/{from.md → to.md} RENAMED
@@ -36,14 +36,14 @@ namespace std {
36
  ```
37
 
38
  The contents and meaning of the header `<cstddef>` are the same as the C
39
  standard library header `<stddef.h>`, except that it does not declare
40
  the type `wchar_t`, that it also declares the type `byte` and its
41
- associated operations ([[support.types.byteops]]), and as noted in
42
  [[support.types.nullptr]] and [[support.types.layout]].
43
 
44
- ISO C 7.19
45
 
46
  ### Header `<cstdlib>` synopsis <a id="cstdlib.syn">[[cstdlib.syn]]</a>
47
 
48
  ``` cpp
49
  namespace std {
@@ -141,14 +141,14 @@ standard library header `<stdlib.h>`, except that it does not declare
141
  the type `wchar_t`, and except as noted in [[support.types.nullptr]],
142
  [[support.types.layout]], [[support.start.term]], [[c.malloc]],
143
  [[c.mb.wcs]], [[alg.c.library]], [[c.math.rand]], and [[c.math.abs]].
144
 
145
  [*Note 1*: Several functions have additional overloads in this
146
- International Standard, but they have the same behavior as in the C
147
- standard library ([[library.c]]). — *end note*]
148
 
149
- ISO C 7.22
150
 
151
  ### Null pointers <a id="support.types.nullptr">[[support.types.nullptr]]</a>
152
 
153
  The type `nullptr_t` is a synonym for the type of a `nullptr`
154
  expression, and it has the characteristics described in 
@@ -159,162 +159,153 @@ another `nullptr_t` object that is an lvalue can be
159
  taken. — *end note*]
160
 
161
  The macro `NULL` is an *implementation-defined* null pointer constant.
162
  [^1]
163
 
 
 
164
  ### Sizes, alignments, and offsets <a id="support.types.layout">[[support.types.layout]]</a>
165
 
166
  The macro `offsetof(type, member-designator)` has the same semantics as
167
  the corresponding macro in the C standard library header `<stddef.h>`,
168
- but accepts a restricted set of `type` arguments in this International
169
- Standard. Use of the `offsetof` macro with a `type` other than a
170
- standard-layout class (Clause  [[class]]) is
171
- conditionally-supported.[^2] The expression
172
- `offsetof(type, member-designator)` is never type-dependent (
173
- [[temp.dep.expr]]) and it is value-dependent ([[temp.dep.constexpr]])
174
- if and only if `type` is dependent. The result of applying the
175
- `offsetof` macro to a static data member or a function member is
176
- undefined. No operation invoked by the `offsetof` macro shall throw an
177
- exception and `noexcept(offsetof(type, member-designator))` shall be
178
- `true`.
179
 
180
  The type `ptrdiff_t` is an *implementation-defined* signed integer type
181
  that can hold the difference of two subscripts in an array object, as
182
  described in  [[expr.add]].
183
 
184
  The type `size_t` is an *implementation-defined* unsigned integer type
185
- that is large enough to contain the size in bytes of any object.
 
186
 
187
  [*Note 1*: It is recommended that implementations choose types for
188
- `ptrdiff_t` and `size_t` whose integer conversion ranks ([[conv.rank]])
189
  are no greater than that of `signed long int` unless a larger size is
190
  necessary to contain all the possible values. — *end note*]
191
 
192
- The type `max_align_t` is a POD type whose alignment requirement is at
193
- least as great as that of every scalar type, and whose alignment
194
- requirement is supported in every context.
195
 
196
- Alignment ([[basic.align]]), Sizeof ([[expr.sizeof]]), Additive
197
- operators ([[expr.add]]), Free store ([[class.free]]), and ISO C 7.19.
198
 
199
  ### `byte` type operations <a id="support.types.byteops">[[support.types.byteops]]</a>
200
 
201
  ``` cpp
202
  template<class IntType>
203
  constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
204
  ```
205
 
206
- *Remarks:* This function shall not participate in overload resolution
207
- unless `is_integral_v<IntType>` is `true`.
208
 
209
- *Effects:* Equivalent to:
210
- `return b = byte(static_cast<unsigned char>(b) << shift);`
211
 
212
  ``` cpp
213
  template<class IntType>
214
  constexpr byte operator<<(byte b, IntType shift) noexcept;
215
  ```
216
 
217
- *Remarks:* This function shall not participate in overload resolution
218
- unless `is_integral_v<IntType>` is `true`.
219
 
220
  *Effects:* Equivalent to:
221
- `return byte(static_cast<unsigned char>(b) << shift);`
 
 
 
222
 
223
  ``` cpp
224
  template<class IntType>
225
  constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
226
  ```
227
 
228
- *Remarks:* This function shall not participate in overload resolution
229
- unless `is_integral_v<IntType>` is `true`.
230
 
231
- *Effects:* Equivalent to:
232
- `return b = byte(static_cast<unsigned char>(b) >> shift);`
233
 
234
  ``` cpp
235
  template<class IntType>
236
  constexpr byte operator>>(byte b, IntType shift) noexcept;
237
  ```
238
 
239
- *Remarks:* This function shall not participate in overload resolution
240
- unless `is_integral_v<IntType>` is `true`.
241
 
242
  *Effects:* Equivalent to:
243
- `return byte(static_cast<unsigned char>(b) >> shift);`
 
 
 
244
 
245
  ``` cpp
246
  constexpr byte& operator|=(byte& l, byte r) noexcept;
247
  ```
248
 
249
- *Effects:* Equivalent to:
250
-
251
- ``` cpp
252
- return l = byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
253
- ```
254
 
255
  ``` cpp
256
  constexpr byte operator|(byte l, byte r) noexcept;
257
  ```
258
 
259
  *Effects:* Equivalent to:
260
 
261
  ``` cpp
262
- return byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
263
  ```
264
 
265
  ``` cpp
266
  constexpr byte& operator&=(byte& l, byte r) noexcept;
267
  ```
268
 
269
- *Effects:* Equivalent to:
270
-
271
- ``` cpp
272
- return l = byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
273
- ```
274
 
275
  ``` cpp
276
  constexpr byte operator&(byte l, byte r) noexcept;
277
  ```
278
 
279
  *Effects:* Equivalent to:
280
 
281
  ``` cpp
282
- return byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
283
  ```
284
 
285
  ``` cpp
286
  constexpr byte& operator^=(byte& l, byte r) noexcept;
287
  ```
288
 
289
- *Effects:* Equivalent to:
290
-
291
- ``` cpp
292
- return l = byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
293
- ```
294
 
295
  ``` cpp
296
  constexpr byte operator^(byte l, byte r) noexcept;
297
  ```
298
 
299
  *Effects:* Equivalent to:
300
 
301
  ``` cpp
302
- return byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
303
  ```
304
 
305
  ``` cpp
306
  constexpr byte operator~(byte b) noexcept;
307
  ```
308
 
309
- *Effects:* Equivalent to: `return byte(s̃tatic_cast<unsigned char>(b));`
 
 
 
 
310
 
311
  ``` cpp
312
  template<class IntType>
313
  constexpr IntType to_integer(byte b) noexcept;
314
  ```
315
 
316
- *Remarks:* This function shall not participate in overload resolution
317
- unless `is_integral_v<IntType>` is `true`.
318
 
319
- *Effects:* Equivalent to: `return IntType(b);`
320
 
 
36
  ```
37
 
38
  The contents and meaning of the header `<cstddef>` are the same as the C
39
  standard library header `<stddef.h>`, except that it does not declare
40
  the type `wchar_t`, that it also declares the type `byte` and its
41
+ associated operations [[support.types.byteops]], and as noted in
42
  [[support.types.nullptr]] and [[support.types.layout]].
43
 
44
+ See also: ISO C 7.19
45
 
46
  ### Header `<cstdlib>` synopsis <a id="cstdlib.syn">[[cstdlib.syn]]</a>
47
 
48
  ``` cpp
49
  namespace std {
 
141
  the type `wchar_t`, and except as noted in [[support.types.nullptr]],
142
  [[support.types.layout]], [[support.start.term]], [[c.malloc]],
143
  [[c.mb.wcs]], [[alg.c.library]], [[c.math.rand]], and [[c.math.abs]].
144
 
145
  [*Note 1*: Several functions have additional overloads in this
146
+ document, but they have the same behavior as in the C standard library
147
+ [[library.c]]. — *end note*]
148
 
149
+ See also: ISO C 7.22
150
 
151
  ### Null pointers <a id="support.types.nullptr">[[support.types.nullptr]]</a>
152
 
153
  The type `nullptr_t` is a synonym for the type of a `nullptr`
154
  expression, and it has the characteristics described in 
 
159
  taken. — *end note*]
160
 
161
  The macro `NULL` is an *implementation-defined* null pointer constant.
162
  [^1]
163
 
164
+ See also: ISO C 7.19
165
+
166
  ### Sizes, alignments, and offsets <a id="support.types.layout">[[support.types.layout]]</a>
167
 
168
  The macro `offsetof(type, member-designator)` has the same semantics as
169
  the corresponding macro in the C standard library header `<stddef.h>`,
170
+ but accepts a restricted set of `type` arguments in this document. Use
171
+ of the `offsetof` macro with a `type` other than a standard-layout class
172
+ [[class.prop]] is conditionally-supported.[^2] The expression
173
+ `offsetof(type, member-designator)` is never type-dependent
174
+ [[temp.dep.expr]] and it is value-dependent [[temp.dep.constexpr]] if
175
+ and only if `type` is dependent. The result of applying the `offsetof`
176
+ macro to a static data member or a function member is undefined. No
177
+ operation invoked by the `offsetof` macro shall throw an exception and
178
+ `noexcept(offsetof(type, member-designator))` shall be `true`.
 
 
179
 
180
  The type `ptrdiff_t` is an *implementation-defined* signed integer type
181
  that can hold the difference of two subscripts in an array object, as
182
  described in  [[expr.add]].
183
 
184
  The type `size_t` is an *implementation-defined* unsigned integer type
185
+ that is large enough to contain the size in bytes of any object
186
+ [[expr.sizeof]].
187
 
188
  [*Note 1*: It is recommended that implementations choose types for
189
+ `ptrdiff_t` and `size_t` whose integer conversion ranks [[conv.rank]]
190
  are no greater than that of `signed long int` unless a larger size is
191
  necessary to contain all the possible values. — *end note*]
192
 
193
+ The type `max_align_t` is a trivial standard-layout type whose alignment
194
+ requirement is at least as great as that of every scalar type, and whose
195
+ alignment requirement is supported in every context [[basic.align]].
196
 
197
+ See also: ISO C 7.19
 
198
 
199
  ### `byte` type operations <a id="support.types.byteops">[[support.types.byteops]]</a>
200
 
201
  ``` cpp
202
  template<class IntType>
203
  constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
204
  ```
205
 
206
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
207
 
208
+ *Effects:* Equivalent to: `return b = b << shift;`
 
209
 
210
  ``` cpp
211
  template<class IntType>
212
  constexpr byte operator<<(byte b, IntType shift) noexcept;
213
  ```
214
 
215
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
216
 
217
  *Effects:* Equivalent to:
218
+
219
+ ``` cpp
220
+ return static_cast<byte>(static_cast<unsigned int>(b) << shift);
221
+ ```
222
 
223
  ``` cpp
224
  template<class IntType>
225
  constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
226
  ```
227
 
228
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
229
 
230
+ *Effects:* Equivalent to: `return b = b >> shift;`
 
231
 
232
  ``` cpp
233
  template<class IntType>
234
  constexpr byte operator>>(byte b, IntType shift) noexcept;
235
  ```
236
 
237
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
238
 
239
  *Effects:* Equivalent to:
240
+
241
+ ``` cpp
242
+ return static_cast<byte>(static_cast<unsigned int>(b) >> shift);
243
+ ```
244
 
245
  ``` cpp
246
  constexpr byte& operator|=(byte& l, byte r) noexcept;
247
  ```
248
 
249
+ *Effects:* Equivalent to: `return l = l | r;`
 
 
 
 
250
 
251
  ``` cpp
252
  constexpr byte operator|(byte l, byte r) noexcept;
253
  ```
254
 
255
  *Effects:* Equivalent to:
256
 
257
  ``` cpp
258
+ return static_cast<byte>(static_cast<unsigned int>(l) | static_cast<unsigned int>(r));
259
  ```
260
 
261
  ``` cpp
262
  constexpr byte& operator&=(byte& l, byte r) noexcept;
263
  ```
264
 
265
+ *Effects:* Equivalent to: `return l = l & r;`
 
 
 
 
266
 
267
  ``` cpp
268
  constexpr byte operator&(byte l, byte r) noexcept;
269
  ```
270
 
271
  *Effects:* Equivalent to:
272
 
273
  ``` cpp
274
+ return static_cast<byte>(static_cast<unsigned int>(l) & static_cast<unsigned int>(r));
275
  ```
276
 
277
  ``` cpp
278
  constexpr byte& operator^=(byte& l, byte r) noexcept;
279
  ```
280
 
281
+ *Effects:* Equivalent to: `return l = l ^ r;`
 
 
 
 
282
 
283
  ``` cpp
284
  constexpr byte operator^(byte l, byte r) noexcept;
285
  ```
286
 
287
  *Effects:* Equivalent to:
288
 
289
  ``` cpp
290
+ return static_cast<byte>(static_cast<unsigned int>(l) ^ static_cast<unsigned int>(r));
291
  ```
292
 
293
  ``` cpp
294
  constexpr byte operator~(byte b) noexcept;
295
  ```
296
 
297
+ *Effects:* Equivalent to:
298
+
299
+ ``` cpp
300
+ return static_cast<byte>(~static_cast<unsigned int>(b));
301
+ ```
302
 
303
  ``` cpp
304
  template<class IntType>
305
  constexpr IntType to_integer(byte b) noexcept;
306
  ```
307
 
308
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
309
 
310
+ *Effects:* Equivalent to: `return static_cast<IntType>(b);`
311