Let Us consider below code

template <class T>
T add(T a, T b)
return ( a + b);
}

Here add is a function template. T a and T b are template arguments. This type of syntax is called function template. As template codes are generated when we call the function. each generated code which is also called instantiated version of function template. This new instantiated version of function is called a template function.



Related Contents to follow