Template class specialization for a given template class

I have a templated Matrix template. I want to write a specialization for complex numbers. How can i do this?

I suspect this won't work:

template <typename T>
class Matrix { ... }

template <typename T2>
class Matrix<std::complex<T2> > { ... }

      

But what will happen?

+2


a source to share


1 answer


You need ;

after every class definition, but other than that your syntax is correct and works.



+3


a source







All Articles