Defining templated functions Normally a function definition is just int add(int t1, int t2); But if it's templated, the definition is template T add(T t1, T t2) { T result = t1 + t2; return result; } Because the function code is needed for instantiation later