I usually use pure virtual functions for those methods that are required by my code to work well. Therefore, I create interfaces and then other users implement their derived
Isn't overloading foo in the base class the easiest solution?
class Base { public: Base(); virtual ~Base(); virtual void foo(int,double)=0; virtual void foo(int,double,double)=0; };