My question is about the difference between:
const T& operator[](const int nIndex) const;
and:
T& operator[](const
If the object you're accessing is const, you don't want to be able to modify it. The compiler wouldn't let you call the non-const version of the function.
const
const vector mints; mints[3] = 5; // not allowed by compiler