class template

hello,

I am writing a class template matrix:

template<class T>

class matrix{
private:
unsigned rows;
unsigned cols;
T **m;
void allocate(T ***,unsigned, unsigned);

public:
matrix(unsigned, unsigned);
~matrix();

void init(T);
....
};
template<class T >
void matrix<T>:: init(T a){
....
}


I would like to make some methods which work only on matrix of int:
should i make something like as follows?

template<>
void matrix<int>:: foo(){


}

thanks


Topic archived. No new replies allowed.