0

内部からconst メンバ関数を持っています。ポインタをbar使用しての基本クラスの関数を呼び出したいと考えています。thisClFoo

ただし、次のようなコンパイラ エラーが発生します。

'ClRDFoo::ReadCounterfile' : cannot convert 'this' pointer from 'const ClFoo' to 'ClRDLFoo &'   

メソッドとクラスは次のとおりです。

//ClFoo.cpp

int ClFoo::bar( void ) const
{
    int nCounter = 0;
    this->ReadCounterFile(&nCounter);
}

//ClFoo.h

class ClFoo : public ClRDFoo
{
protected: 

      int ClFoo::bar( void ) const;

}

//ClRDFoo.h

  class ClRDFoo 
    {

    protected:
         virtual bool ReadCounterFile(void *pBuffer);

    }
4

3 に答える 3