I have begun programming matrix class using templates. The definition of class is as follows:
template <class T> class matrixNow I'm trying to program a class for exception handling. It would take the matrix class where error happened and a message as parameters and could be used as:
throw new matrixError ( this, "An error");
But as the matrix class uses templates, I am not able to just define constructor like
matrixError ( matrix * m, std::string msg );
I think that something like
template <class T> class matrixError throw new matrixError<T>(this, "An error");would solve the problem, but I first ask is there some other, and better ways to solve this problem, or am I developing this whole exception handling from totally wrong view?


Sign In
Create Account

Back to top









