#include using namespace std; template someType sum (someType a, someType b) { return a+b; } template T sum2 (T a, T b) { T result; result = a+b; return result; } template bool r_eq(T a, U b) { return (a==b); } template T fixed_mul(T val) { return val*n; } int main() { int x = sum(10,45); int i=5 ,j=6, k; double f=2.0, g=0.5, h; k = sum2(i,j); h = sum2(f,g); cout<(10,10.0) */ cout<(10)<<"\n"; cout<(10)<<"\n"; /* the value of template params r determined on compile-time to generate a diff instantiation of the func fixed_mul and thus the value of that argument is never passed on runtime. The two calls to fixed_multiply in main essentially call two versions of the function : one that always mul by 2 and other by 3. For that same reason, the second template argument needs to be a const expr, u cant use variable in that case. */ return 0; }