template <class T,class U>
T tripleVal(U val)
{
val = val * 3;
return val;
}
template <class V>
V tripleVal2(V val)
{
val = val * 3;
return val;
}
int main()
{
cout << tripleVal(5.5) << endl;// Error for this line of code tripleVal(5.5)
//only works if i add <int> or <double> like this tripleVal <double>(5.5)
cout << tripleVal2(5.5) << endl; // works as per normal
}