consider the following class template:
template
class MyClass
{
void MyFunc();
};
template
void MyClass::MyFunc()
{
Try this one :
template
class MyClass
{
public:
static void MyFunc2(T2* data);
};
template
void MyClass::MyFunc2(T2* pData)
{
cout << "dummy " << *pData<< "\n";
}
Then
int main()
{
cout << "Hello World!\n";
MyClass a;
int *b = (int*)malloc(sizeof(int));
*b = 5;
a.MyFunc2(b);
}
Output
Hello World!
dummy 5