Override number of parameters of pure virtual functions

前端 未结 5 1801
眼角桃花
眼角桃花 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:03

    Even if such a thing were possible, it no longer makes much sense to have it as a virtual function, as the derived instantiations couldn't be called polymorphically via a pointer to the base class.

提交回复
热议问题