Overload of pure virtual function

后端 未结 6 596
无人及你
无人及你 2021-01-12 23:45

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

6条回答
  •  孤街浪徒
    2021-01-13 00:00

    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;
    };
    

提交回复
热议问题