What is the reason that the second class is not standard layout? (Visual Studio C++)
#include <iostream>
#include <type_traits>
struct A
{
int i;
};
struct B : public A
{
};
std::cout << "is_standard_layout<B> == "
<< std::boolalpha
<< std::is_standard_layout<B>::value // gives false
<< std::endl;
Accorting to this MSVC supports built-in type traits since version 8 but this seems to say that you need version 11.
Section 9.7 defines a standard-layout class as a class that:
There’s some explanation here.