calling an object

Hi,
How can I write a class which instantiation can be called this way object(1,2)? To be specific, first I create an object object, which for the purpose of this discussion can be thought of as a matrix, and than I want to access its elements by object(1,2).
1
2
3
4
5
class matrix{
public:
  T& operator()(int, int);
  const T& operator()(int, int) const;
};
Topic archived. No new replies allowed.