Maxime
Maxime

Reputation: 81

Specialization of template class for a given templated class

I have a templated class Matrix. I want to write a specialization for complex numbers. How can I do that ?

I suspect this won't work :

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

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

But what will ?

Upvotes: 2

Views: 81

Answers (1)

sth
sth

Reputation: 229874

You need ; after each class definition, but aside of that your syntax is correct and works.

Upvotes: 3

Related Questions