Quote Originally Posted by Nextstopearth
In the other example in this thread you don't just replace the template parameter with the exact type of the actual argument, something more happens.
Yes. Let's consider this again:
Code:
template <typename T>
void func(T arg);
Now, you write:
Code:
double* p;
func(p);
So, T is double*. But now we change it to:
Code:
template <typename T>
void func(T* arg);
If T is still double*, then it follows that the * has changed nothing. In other words, using your reasoning, this:
Code:
template <typename T>
void func(T arg);
and this:
Code:
template <typename T>
void func(T**************************************** arg);
still result in T being of type double* if the argument is of type double*. Does that make sense to you? It does not make sense to me.