When trying to access a derived class functionality in a base class, Curiously Recurring Template Pattern (CRTP) provides a useful interface. Inheriting from a template base class, derived class is used as the template parameter of the base class. From the perspective of the base object, the derived object is itself, but downcasted.
template <typename T>
class Base
{
public:
void doSomething()
{
T& derived static_cast<T&> (*this); // use derived...
}
};
class Derived public Base<Derived>
{
//...
};