The struct vec takes a template parameter T, and it's constructor takes a different template parameter U. Therefore, you must specify both template directives when defining the constructor; one for the class type, and one for the constructor's argument.