You cannot separate an implementation from an declaration using template classes, as you can, using regular classes. You can do it, but it's a little "hacked:"
#ifndef TEMPLATE_H_INCLUDED
#define TEMPLATE_H_INCLUDED
template <typename ClassDatatype>
class MyTemplateClass
{
template <typename MethodDatatype>
void MyMethod(MethodDatatype Argument);
}
#include "Template.cpp"
#endif
#ifndef TEMPLATE_CPP_INCLUDED
#define TEMPLATE_CPP_INCLUDED
#include "Template.h"
template <typename ClassDatatype>
template <typename MethodDatatype>
void MyTemplateClass<ClassDatatype>::MyMethod(MethodDatatype Argument)
{
}
#endif
source
share