I need to upcast a virtual class member function (to call a base class implementation of that function), but I don't want to slice the object (create a new copy of the object as the base class type) because of performance reasons.
How is this done?
Example:
Dan East
How is this done?
Example:
- Code:
class base {
virtual void foo();
};
class derived : base {
virtual void foo();
}
derived a;
a.foo(); //Want to call base::foo here, not derived::foo
Dan East