What will be the syntax for calling a non-member operator[]? Any syntax for this would be inconvenient. operator[]takes one parameter within [and ]and is usually the index or data needed to search for an object.
Also, yes, it is a good idea to return the link, even if it is a private member. This is what STL vectors do, and just about any other class that I could think of that I have ever used, which provides operator[]. It would be recommended that it be supported.
source
share