Is it safe to do the following or is it undefined behaviour:
class Base
{
private:
int a;
};
class Derived : public Base
{
private:
int b;
};
Base x;
Derived y;
x = y; // safe?
Do the extra bits in derived classes just get sliced off?