P
puzzlecracker
something that befuddled me for years, please disambiguate my
confusion:
Two verstions of functional templates:
A) B)
template <typename T> template <typename T>
void f(T a, T b); void f(T * a, T* b);
int a;
int &b=a;
When we call f(a); why would call instantiate a pointer template
(B) instead of (A)?
why is it different - given that both are -underlined- text
substitution after type deduction?
and pointer type is an actual type.
my understadning is if we only have B) the call would result
in
void (int ** a, int * *b); apparently it doesn't...
Thanks.
...cracker.
confusion:
Two verstions of functional templates:
A) B)
template <typename T> template <typename T>
void f(T a, T b); void f(T * a, T* b);
int a;
int &b=a;
When we call f(a); why would call instantiate a pointer template
(B) instead of (A)?
why is it different - given that both are -underlined- text
substitution after type deduction?
and pointer type is an actual type.
my understadning is if we only have B) the call would result
in
void (int ** a, int * *b); apparently it doesn't...
Thanks.
...cracker.