Overloading on const
It is possible to have two member functions with the same name and arguments that differ on whether the function is const:
class IntArray {
// ...
int& operator[](int);
int operator[](int) const;
};
Previous slide
Next slide
Back to first slide
View graphic version