From Jason Turner

[support.types.layout]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpdrenx7m7/{from.md → to.md} +35 -0
tmp/tmpdrenx7m7/{from.md → to.md} RENAMED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Sizes, alignments, and offsets <a id="support.types.layout">[[support.types.layout]]</a>
2
+
3
+ The macro `offsetof(type, member-designator)` has the same semantics as
4
+ the corresponding macro in the C standard library header `<stddef.h>`,
5
+ but accepts a restricted set of `type` arguments in this International
6
+ Standard. Use of the `offsetof` macro with a `type` other than a
7
+ standard-layout class (Clause  [[class]]) is
8
+ conditionally-supported.[^2] The expression
9
+ `offsetof(type, member-designator)` is never type-dependent (
10
+ [[temp.dep.expr]]) and it is value-dependent ([[temp.dep.constexpr]])
11
+ if and only if `type` is dependent. The result of applying the
12
+ `offsetof` macro to a static data member or a function member is
13
+ undefined. No operation invoked by the `offsetof` macro shall throw an
14
+ exception and `noexcept(offsetof(type, member-designator))` shall be
15
+ `true`.
16
+
17
+ The type `ptrdiff_t` is an *implementation-defined* signed integer type
18
+ that can hold the difference of two subscripts in an array object, as
19
+ described in  [[expr.add]].
20
+
21
+ The type `size_t` is an *implementation-defined* unsigned integer type
22
+ that is large enough to contain the size in bytes of any object.
23
+
24
+ [*Note 1*: It is recommended that implementations choose types for
25
+ `ptrdiff_t` and `size_t` whose integer conversion ranks ([[conv.rank]])
26
+ are no greater than that of `signed long int` unless a larger size is
27
+ necessary to contain all the possible values. — *end note*]
28
+
29
+ The type `max_align_t` is a POD type whose alignment requirement is at
30
+ least as great as that of every scalar type, and whose alignment
31
+ requirement is supported in every context.
32
+
33
+ Alignment ([[basic.align]]), Sizeof ([[expr.sizeof]]), Additive
34
+ operators ([[expr.add]]), Free store ([[class.free]]), and ISO C 7.19.
35
+