std::max_align_t

Header: <cstddef>

std::max_align_t is a standard-layout TrivialType(until C++26)TriviallyCopyable type(since C++26) whose alignment requirement is at least as strict (as large) as that of every scalar type.

# Declarations

typedef /* implementation-defined */ max_align_t;

(since C++11)

# Notes

Pointers returned by allocation functions such as std::malloc are suitably aligned for any object, which means they are aligned at least as strictly as std::max_align_t.

# Example

#include <cstddef>
#include <iostream>
 
int main()
{
    std::cout << alignof(std::max_align_t) << '\n';
}

# See also