Hi,
In the following code, we have created a template function,
We expected the output to display "A::A()" and "B::B()" but we are getting
both as "B::B()".
class A
{
public:
A()
{
cout<<endl<<"A::A()";
}
};
class B
{
public:
B()
{
cout<<endl<<"B::B()";
}
};
template<class T>
void func()
{
T t;
}
int main(int argc, char* argv[])
{
func<A>();
func<B>();
return 0;
}
Please clarify.
Compiler Used: VC++ 6.0
Regards,
VSP