next up previous
Next: How do I write Up: What are templates? Previous: How do I specify

How do I put the code of template methods outside classes?

template <class T, int N>
class   Vector
  T	array[N];
  void	reset();

template <class T, int N>
void	Vector<T, N>::reset()
  for (int i(0); i < N; ++i) array[i] = 0;

Alexis Angelidis (PhD) 2005-01-11