If I have one template class and template function like this
template <class T> T getMax (T a, T b) {
return (a>b?a:b);
}
template <class T> class GetMax {
public:
static T getMax(T a, T b) {
return (a>b?a:b);
}
};
Why are these not valid?
x=getMax(1, '2');
but these are valid
x=getMax(1,2);
Does it mean that there is no type conversion in template function?
This is not valid
x=GetMax::getMax(1, 2);
Does it mean that for the template class, the type must be specified?