我是C++的新手,我很抱歉因为这个问题,但这是一场斗争.如果有人能帮助我区分以下几行,我会很感激.
char& operator [](int); // write (why with reference?)
char operator [](int) const; //read (why without a reference?)
char const &operator[](int) const; // what is the difference compared to the previous line?
const char *& operator[] (const int* ); // is this also possible?
Run Code Online (Sandbox Code Playgroud)