consider the following template class.
template <class T>
class MyClass
{
void MyFunc();
}
template <class T>
void MyClass<T>::MyFunc()
{
//...implementation goes here
}
I need to add another function MyFunc2 which accepts an additional Template arg T2 i.e
template <class T>
class MyClass
{
void MyFunc();
template <class T2>
static void MyFunc2(T2* data);
}
template <class T>
void MyClass<T>::MyFunc()
{
//...implementation goes here
}
template <class T, class T2>
void MyClass<T>::MyFunc2(T2* pData)
{
//...implementation goes here
}
I am using VS 2008 compiler. I am getting the error
error C2244: unable to match function definition to an existing declaration
How should the the functions definition and declaration look like in this case.