template struct Poco::AlignOf

Overview

A templated class that contains an enum value representing the alignment of the template argument. More…

#include <Alignment.h>

template <typename T>
struct AlignOf
{
    // enums

    enum
    {
        Alignment = static_cast<unsigned int>(sizeof(AlignmentCalcImpl<T>) - sizeof(T)),
    };
};

Detailed Documentation

A templated class that contains an enum value representing the alignment of the template argument.

For example, AlignOf<int>::Alignment represents the alignment of type “int”. The alignment calculated is the minimum alignment, and not necessarily the “desired” alignment returned by GCC’s alignof (for example). Note that because the alignment is an enum value, it can be used as a compile-time constant (e.g., for template instantiation).