I want to pass any-type parameter to my function func1()
.
So here is my code:
myclass.h :
public:
myclass();
template<typename T> void func1(T object);
myclass.cpp :
template<typename T>
void myclass::func1(T object)
{
return;
}
main.cpp :
int a=0;
myclass::func1<int>(a);
But I got this error :
error: cannot call member function 'void myclass::func1(T) [with T = int]' without object
Where is my mistake?