can references used implement function overriding? can have base-class reference points derived-class object, , feature of late binding?
yes. reason that, in c++, derived class object contains hidden pointer record details object's actual type. both pointer , record remain, when reference binds object in question.
this assumes, @simon observes, have declared function virtual in base class. (otherwise, needed hidden pointer not exist.)
Comments
Post a Comment