Yog*_*ora 4 c++ const operator-overloading
假设我已经在类中声明了下标运算符
char& operator[] (int index);const char operator[](int index) const;在什么条件下调用第二个重载.它只是通过一个叫做const object.
在以下场景中将调用哪个版本的运算符.
const char res1 = nonConstObject[10];
nonConstObject[10];
Run Code Online (Sandbox Code Playgroud)