if I do
void func(int x)
{ cout << "in func" << endl; }
int main()
{
func;
return 0;
}
No outoput will be produced, since func is not a function call.
Now, in I do
template<int N>
void func(int x)
{ cout << "in func" << endl; }
int main()
{
func<"hhh">;
return 0;
}
The compiler will even NOT produce the code for "func", since code is produce at the time it is required to be used.
If I do
int main()
{
func<"hhh">(128);
return 0;
}
The compiler attempt to generate
func<"hhh">(int)
and have no way to do, hence will generate an error.
If I do
int main()
{
func<10>(100);
return 0;
}
The compiler generates
func<10>(int)
and calls it passing 100 as a parameter.
Now, you understand all this correctly, it should be clear to you that
func<10>
and
func<15>
are two different and distinct functions.