bool check_integrity( int pos ) const
{
if (( pos <= 0 ) || ( pos > max_seq ) || ( pos >= _length + _beg_pos ))
{
cerr << "!! invalid position: " << pos
<< " Cannot honor request\n";
return false;
}
if ( _isa == ns_unset )
{
cerr << "!! object is not set to a sequence."
<< " Please set_sequence() and try again!\n";
return false;
}
if ( pos > _elem->size()){
cout << "check_integrity: calculating "
<< pos - _elem->size() << " additional elements\n";
( this->*_pmf )( pos );
}
return true;
}
public:
typedef void (num_sequence::*PtrType)( int );
private:
PtrType _pmf;
上面的代码片段是“num_sequence”类的一部分。我收到以下行的错误:
( this->*_pmf )( pos );
错误是:'const num_sequence *const this' 错误:对象具有与成员函数不兼容的类型限定符
谢谢!