Override number of parameters of pure virtual functions

前端 未结 5 1813
眼角桃花
眼角桃花 2020-12-16 11:16

I have implemented the following interface:

template 
class Variable
{
public:
  Variable (T v) : m_value (v) {}
  virtual void Callback ()         


        
5条回答
  •  再見小時候
    2020-12-16 12:04

    don't think this will be possible, because you can never interface it back to Variable. This is what i mean

    int a=0; int b = 0;
    Variable* derived = new Derived();
    derived->Callback(a, b); //this won't compile because Variable does not have Callback with 2 vars.
    

提交回复
热议问题