智能感知“没有可用的成员”

时间:2021-05-02 21:20:49

标签: c++ inheritance polymorphism abstract-class intellisense

在 c++ 中使用继承和泛型,这个问题出现在我面前: 这是我的抽象基类

    template<class Type>
struct A
{
Type info;
};
template<class Type>
class base
{
protected:
     A<Type>* ptrA;
public:
    virtual void func(Type X) = 0;
    void func(Type X) 
     {
         ptrA->info = x;         //no Errors occured
     }
};

这是派生的

template<class Type>
class derived : class base<Type>
{
public:
  void func(Type X)
  {
    ptrA-> info  = x ;       // this is the problem 

  }
};

问题出现在派生类的函数定义处:我无法访问 成员 ptrA refrenced,,, 任何帮助,请

0 个答案:

没有答案
相关问题