I am getting compilation error in below code.
class A
{
public:
A()
{
}
~A()
{
}
void func()
{
cout <<"Ha ha ha \n";
}
};
class C
{
public:
C()
{
}
~C()
{
}
template<typename type> func()
{
type t;
t.func();
}
void callme()
{
func<A>();
}
};
VC6 doesn’t support member function templates. You actually have several solutions:
Move
func()out of the class definitionor rewrite
callme()or use class template