Suppose I have:
class Base {
public:
virtual void Nothing() {}
};
class MiddleDerived : public Base {
virtual void Nothing() {}
};
class Derived : public MiddleDerived {
virtual void Nothing() {}
};
and my code goes like this:
Derived* object = new Derived();
Base* base = object; //implicit conversion here
void* derivedVoid = object;
void* baseVoid = base;
Should I expect that baseVoid == derivedVoid
?
I know that most implementations work this way but is it guaranteed?