内部からconst メンバ関数を持っています。ポインタをbar
使用しての基本クラスの関数を呼び出したいと考えています。this
ClFoo
ただし、次のようなコンパイラ エラーが発生します。
'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);
}