Which function is called depends on whether the instance is const or not. The first version allows you to change the instance:
Matrix<int> matrix;
matrix(0, 0) = 10;
Overloading const allows read-only access if you have an instance of a const (reference) Matrix:
void foo(const Matrix<int>& m)
{
int i = m(0, 0);
}
, ( , , ).
T , (er) . T , const const:
template <class T>
class MyContainer
{
T& operator[](size_t);
const T& operator[](size_t) const;
}