Why is the empty base class optimization (EBO) not being fully applied in Visual C++?
If I have a lot of base classes, is there any way for me to help the compiler make this optimization?
#include <iostream>
struct T1 { };
struct T2 { };
struct T3 { };
struct T4 { };
struct T5 { };
struct T6 { };
struct Test : T1, T2, T3, T4, T5, T6 { };
int main() { std::cout << sizeof(Test); } // Prints 5