c/language/ Alignas

Appears in the syntax as one of the type specifiers to modify the  of the object being declared.

Syntax
This keyword is also available as convenience macro, available in the header.

Explanation
The specifier can only be used when declaring objects that are not, and don't have the  storage class. It cannot be used in function parameter declarations, and cannot be used in a typedef.

When used in a declaration, the declared object will have its set to @1@ the result of the, unless it is zero @2@ to the alignment requirement of, that is, to

except when this would weaken the alignment the type would have had naturally.

If evaluates to zero, this specifier has no effect.

When multiple specifiers appear in the same declaration, the strictest one is used.

specifier only needs to appear on the of an object, but if any declaration uses, it must specify the same alignment as the  on the definition. The behavior is undefined if different translation units specify different alignments for the same object.