Files
2025-10-25 03:02:53 +03:00

1.7 KiB
Raw Permalink Blame History

[expr.alignof]

7 Expressions [expr]

7.6 Compound expressions [expr.compound]

7.6.2 Unary expressions [expr.unary]

7.6.2.6 Alignof [expr.alignof]

1

#

An alignof expression yields the alignment requirement of its operand type.

The operand shall be a type-id representing a complete object type, or an array thereof, or a reference to one of those types.

2

#

The result is a prvalue of type std::size_t.

[Note 1:

An alignof expression is an integral constant expression ([expr.const]).

The typedef-name std::size_t is declared in the standard header ([cstddef.syn], [support.types.layout]).

— end note]

3

#

When alignof is applied to a reference type, the result is the alignment of the referenced type.

When alignof is applied to an array type, the result is the alignment of the element type.