RAD Studio |  |

alignof
See Also
Collapse All

Category

Operators, Keyword extensions

Syntax

Copy Code

    alignof(type);

Description

The alignof operator tells you the alignment of a type. This feature is one of the C++0x features added to C++Builder 2009.

The result is an integer constant of type std::size_t. The value indicates the boundaries on which elements of that type are aligned in memory. An alignment of 2 means that the type must begin on even memory addresses, for instance. A typical value for alignof(double) might be 8.

Applying alignof to a reference type yields the alignment of the referenced type. If you apply alignof to an array type, you get the alignment of its element's type.

See Also

C++0x Features (C++Builder 2009)

Working Draft - Standard for Programming Language C++ (Sec. 5.3.6)

alignof Operator (C++0x)

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!