_Alignas
Sets the alignment requirement of the declared object or member to the specified alignment.
Contents |
[edit] Syntax
_Alignas( type-name )
|
(since C11) | ||||||||
_Alignas( constant-expression )
|
(since C11) | ||||||||
[edit] Explanation
Alignment is the requirement that objects of a particular type be located on storage boundaries with addresses that are particular multiples of a byte address.
Complete object types have alignment requirements which place restrictions on the addresses at which objects of that type may be allocated. An alignment is an implementation-defined integer value representing the number of bytes between successive addresses at which a given object can be allocated. An object type imposes an alignment requirement on every object of that type.
Alignments have an order from weaker to stronger, or stricter, alignments. Stricter alignments have larger alignment values. Stricter alignments can be requested using the _Alignas keyword.
Alignments are represented as values of the type size_t.