Programming classes

Member functions of our class are defined by preceding the name of the function with the template keyword. Consider the function we defined as Complex:: Complex (double re_a, double im_a). We would rewrite this function as

template<class T>
Complex<T>:: Complex (T re_a, T im_a)
{ re = re_a; im = im_a; }

The member functions are otherwise defined following ordinary member function definitions.