N
Naveen
I am trying to build a very simple template function like this:
class A
{
public:
};
void fun(int k)
{
}
void fun(double k)
{
}
void fun(const A& a)
{
}
template <class T>
void myFun()
{
T t;
fun(t);
}
int main()
{
myFun<A>();
myFun<double>();
myFun<int>();
return 0;
}
But when I debug I find that each of the function calls from inside the
template function myFun() goes void fun(int k) irrespective of the template
type. Am I missing something very basic here ? I am using VC6 compiler.
class A
{
public:
};
void fun(int k)
{
}
void fun(double k)
{
}
void fun(const A& a)
{
}
template <class T>
void myFun()
{
T t;
fun(t);
}
int main()
{
myFun<A>();
myFun<double>();
myFun<int>();
return 0;
}
But when I debug I find that each of the function calls from inside the
template function myFun() goes void fun(int k) irrespective of the template
type. Am I missing something very basic here ? I am using VC6 compiler.