Why is the following not working?
If sizeof(B)
is 8, so sizeof(C)
should also be 8 since it's inheriting from a single classe, EBO should've been still be used here.
Do I really have to use __declspec(empty_bases)
here? :/
struct A {};
struct B : A {
size_t x;
};
struct C : A {
B b;
};
int
main() {
static_assert(sizeof(C) == sizeof(size_t));
return 0;
}