Request Short Link
C++ 98
C++ 11
C++ 14
C++ 17
C++ 20
C++ 23
C++ 2c
for-loops as while-loops
array subscription
Show all implicit casts
Show all template parameters of a CallExpr
Use libc++
Transform std::initializer_list
Show noexcept internals
Show padding information
Show coroutine transformation
Show C++ to C transformation
Show object lifetime
Default
15
18
20
22
26
More
GitHub
Patreon
Issues
About
Policies
Examples
C++ Insights @ YouTube
Settings
Version
Need in-house C++ training? Learn more here
×
Made by
Andreas Fertig
Powered by
Flask
and
CodeMirror
Source:
#include <complex> #include <cstdio> #include <string> struct dummy { std::complex<double> a; double b; std::int64_t b2; int c; }; struct data { std::complex<double> a; double b; std::int64_t b2; int c; char padding[((offsetof(dummy, c) + sizeof(c))/sizeof(std::complex<double>)+1)*sizeof(std::complex<double>) - sizeof(dummy)]; }; int main() { static_assert(sizeof(data)%sizeof(std::complex<double>) == 0); }
Insight:
Console: