为什么我不能将该函数ColPeekHeight()
用作左值?
class View
{
public:
int ColPeekHeight(){ return _colPeekFaceUpHeight; }
void ColPeekHeight( int i ) { _colPeekFaceUpHeight = i; }
private:
int _colPeekFaceUpHeight;
};
...
{
if( v.ColPeekHeight() > 0.04*_heightTable )
v.ColPeekHeight()-=peek;
}
编译器在v.ColPeekHeight()-=peek
. 我怎样才能ColPeekHeight()
得到一个左值?