C++ 关键词:alignas
(C++11 起)
来自cppreference.com
用法
示例
struct s1 final {}; struct alignas(2) s2 final {}; static_assert(alignof(s1) == 1); static_assert(alignof(s2) == 2);