classInstanceAlignment

Different than T.alignof, which is the same for all class types, $(D_PSYMBOL classInstanceOf) determines the alignment of the class instance and not of its reference.

template classInstanceAlignment (
T
) if (
is(T == class)
) {}

Members

Variables

classInstanceAlignment
enum size_t classInstanceAlignment;
Undocumented in source.

Parameters

T

A class.

Return Value

Alignment of an instance of the class T.

Examples

class C1
{
}
static assert(classInstanceAlignment!C1 == C1.alignof);

static struct S
{
    align(8)
    uint s;

    int i;
}
class C2
{
    S s;
}
static assert(classInstanceAlignment!C2 == S.alignof);

Meta