|
|
Basic types | |||||||||||
Fixed width integer types(C++11) | |||||||||||
Fixed width floating-point types(C++23) | |||||||||||
Numeric limits | |||||||||||
C numeric limits interface | |||||||||||
Runtime type information | |||||||||||
|
Defined in header <cstddef> | ||
typedef/* implementation-defined */ max_align_t; | (since C++11) | |
std::max_align_t
is astandard-layoutTrivialType(until C++26)TriviallyCopyable type(since C++26) whosealignment requirement is at least as strict (as large) as that of every scalar type.
std::is_trivially_default_constructible_v<std::max_align_t> istrue.
Contents |
Pointers returned by allocation functions such asstd::malloc are suitably aligned for any object, which means they are aligned at least as strictly asstd::max_align_t
.
#include <cstddef>#include <iostream> int main(){std::cout<< alignof(std::max_align_t)<<'\n';}
Possible output:
16
alignof (C++11) | queries alignment requirements of a type (operator)[edit] |
(C++11) | obtains the type's alignment requirements (class template)[edit] |
(C++11) | checks if a type is a scalar type (class template)[edit] |
C documentation formax_align_t |