Hi Everyone,
Its know that c++ compiler instantiates a new version of the
function/class when it sees a usage of a function/class template with a
particular data type, assuming that c++ supports 10 data types, how
many versions of the function template would be created for the
following example?
template <class T>
T sample(T value)
{
return T * T;
}
int main()
{
int i=5;
sample(i);
}
Would the compiler create one version of the function to handle int
data type or as many versions as many as the number of data types that
c++ supports?