alignas(n)
지정한 수의 배수만큼 구조체가 할당된다.(1 or 2 의 배수로 설정해야함)
struct alignas(32) Alignas
{
	int i4;	// 4 byte
	char c[3];	// 3 byte
	short s2;	// 2 byte
};
Alignas al;
cout << sizeof(al) << endl;	// 32 byte
https://en.cppreference.com/w/cpp/language/alignas
alignas specifier (since C++11) - cppreference.com
Specifies the alignment requirement of a type or an object. [edit] Syntax alignas( expression ) alignas( type-id ) alignas( pack ... ) 2) Equivalent to alignas(alignof(type-id)) 3) Equivalent to multiple alignas specifiers applied to the same declaration,
en.cppreference.com
'::public > C++' 카테고리의 다른 글
| (c++11) lambda (0) | 2023.02.08 | 
|---|---|
| (C++11) std::move (0) | 2023.01.31 | 
| byte padding(바이트 패딩) (0) | 2023.01.18 | 
| (C++11) chrono (0) | 2023.01.04 | 
| GetCurrentDirectory, GetModuleFileName (0) | 2021.07.01 |