alignment_of

| Home | Libraries | People | FAQ | More

### alignment_of

    template <class T>
    struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};

Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, ALIGNOF(T)>`, where` ALIGNOF(T)` is the alignment of type T.

Note: strictly speaking you should only rely on the value of `ALIGNOF(T)` being a multiple of the true alignment of T, although in practice it does compute the correct value in all the cases we know about.

Header: `#include <boost/type_traits/alignment_of.hpp>` or `#include <boost/type_traits.hpp>`

Examples:

> `alignment_of<int>` inherits from `integral_constant<std::size_t, ALIGNOF(int)>`.

> `alignment_of<char>::type` is the type `integral_constant<std::size_t, ALIGNOF(char)>`.

> `alignment_of<double>::value` is an integral constant expression with value `ALIGNOF(double)`.

> `alignment_of<T>::value_type` is the type `std::size_t`.