问题 Why the following code doesn't compile? namespace mtm { template<class T> class Matrix { private: public: class AccessIllegalElement; }; Matrix::AccessIllegalElement{}; } I'm trying to implement the inner class for handling errors Error I get: 'Matrix' is not a class, namespace, or enumeration Plus, if inside AccessIllegalElement I want to write a function that prints the illegal index what is preferable? 1) to define a function that takes one parameter 2) to give every class object a member