Method of derived class needs to downcast its parameter
<p>Here is a sample code:</p>

<pre>
class Base {
public:
    virtual void common();
};

class Derived {
public:
    void common();
    virtual void spec(); // added function specific for this class
};

class BaseTracker {
public:
    void add(Base* p);
private:
    vector &lt Base* &gt vec;
};

class DerivedTracker {
public:
    void add(Derived* p);
private:
    vector &lt Derived* &gt vec;
};
</pre>

<p>I want DerivedTracker and BaseTracker to be derived from class Tracker, because a lot of code for these two classes is the same, except one method, add(). DerivedTracker::add() method needs to call functions specific to Derived class. But I don't want to do dynamic casting. I think it is not the case when I should use it. Also Tracker class should include container, so functions which are implemented in this class could use it.</p>
