, , , . , , .
, , CPP, . , .
file.cpp
template<class Gizmo> bool DoSomethingFancy()
{
}
, , H:
utility.h
template<class Gizmo> bool DoSomethingUseful()
{
}
, , . , :
utility.h
template<class Type> class Useful
{
bool FunctionA();
bool FunctionB();
};
template<class Type> bool Useful<Type>::FunctionA()
{
}
template<class Type> bool Useful<Type>::FunctionB()
{
}
. , INC . #include INC :
utility.h:
template<class Type> class MoreUseful
{
bool FunctionA();
bool FunctionB();
};
#include "utility.inc"
utility.inc:
template<class Type> bool MoreUseful<Type>::FunctionA()
{
}
template<class Type> bool MoreUseful<Type>::FunctionB()
{
}