P
persres
Hi,
I incorrectly definted a member function as follows :
ABC.h :
void ABC<class T>::func1()
{
}
I guess I should have defined it as :
template <class T>
void ABC<T>::func1()
{
}
Can you please tell me what the first one means? I never knew that had
any meaning. It was a mistake by me as I have not been programming for
over 4 years. However, it compiles. When I include that in multiple
cpp files, while linking I get multiple definitions - As though the
compiler treats it as a plain old function and not as a template.
I would think the first one should not compile as its incorrect
syntax. I am using VC2008.
Any help please.
Thanks
I incorrectly definted a member function as follows :
ABC.h :
void ABC<class T>::func1()
{
}
I guess I should have defined it as :
template <class T>
void ABC<T>::func1()
{
}
Can you please tell me what the first one means? I never knew that had
any meaning. It was a mistake by me as I have not been programming for
over 4 years. However, it compiles. When I include that in multiple
cpp files, while linking I get multiple definitions - As though the
compiler treats it as a plain old function and not as a template.
I would think the first one should not compile as its incorrect
syntax. I am using VC2008.
Any help please.
Thanks