Template function within template class

Hello All,
I'm guessing I'm making some sort of rookie mistake here. Basically, I have a class with template member functions, but I feel my class is not recognizing my template functions:

File: t1.h
template<class T> class test
{
\\ blah
void create();
}

File: t1.cpp
template <class T> void Vec<T>::create()
{
\\blah
}


I get the error:
/tmp/ccGusfFA.o(.text+0x2f): In function `main':
: undefined reference to `Vec<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::create()'


It works excellently when I scrap the .cpp file and load everything into a single .h file (say t1.h), I was wondering if perhaps there was something wrong with my declarations? Is this even possible??

Any assistance is most appreciated.

Anom!

Last edited on
Topic archived. No new replies allowed.