Suppose I declared indexes in a class
char& operator[] (int index);const char operator[](int index) const;
In what state is the second overload called. Is this called only through a const object .
In the following scenarios, the statement version will be called.
const char res1 = nonConstObject[10]; nonConstObject[10];
source share