那我就顺便再问个问题吧
double operator[](int i)const
double operator[](int i)
这2个函数的真正区别究竟何在?
我知道常函数是不允许修改调用对象的数据成员的
所以double operator[](int i)const
到底何时被调用呢?
那我就顺便再问个问题吧
double operator[](int i)const
double operator[](int i)
这2个函数的真正区别究竟何在?
我知道常函数是不允许修改调用对象的数据成员的
所以double operator[](int i)const
到底何时被调用呢?
今天看MFC程序时,看到一个我以前都不知道的问题。
const成员函数与普通成员函数的不同:const对象只能调用const成员函数。