Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc 12.3.0

Options
Boost 1.81.0
C++2b(GNU)
no pedantic

$ g++ prog.cc -I/opt/wandbox/boost-1.81.0-gcc-12.3.0/include -std=gnu++2b
align

struct A
{  // non-POD type
	int avg;
	A(int a, int b) : avg((a + b) / 2) {}
};

std::aligned_storage<sizeof(A), alignof(A)>::type A_pod;
	

aligned_union

union U
{
	int i;
	char c;
	double d;
	U(const char* str) : c(str[0]) {}
};   // non-POD

std::aligned_union<sizeof(U), int, char, double>::type U_pod;
Exit Code:
0