Код: Выделить всё
// MyFile.h
#ifndef MYFILE_H_INCLUDED
#define MYFILE_H_INCLUDED
template
class MyClass
{
public:
void MyMethod();
}
#include "MyFile.cpp"
#endif
Код: Выделить всё
// MyFile.cpp
#ifndef MYFILE_CPP_INCLUDED
#define MYFILE_CPP_INCLUDED
#include "MyFile.h"
template
void MyClass::MyMethod()
{
// ...
}
#endif
Подробнее здесь: https://stackoverflow.com/questions/546 ... -templates