hi,
I have a template class declared in a .h file,
and the implementation in a .C file.
Is it at all possible to compile the source by including the .C file in the .h?
Can a .o be created from a template at compile time?
thanks in advance
Printable View
hi,
I have a template class declared in a .h file,
and the implementation in a .C file.
Is it at all possible to compile the source by including the .C file in the .h?
Can a .o be created from a template at compile time?
thanks in advance
You can use an include directive to copy the code in the c files to the h file, and then include the h file where it is needed -
template.h-
//declarations and any inline definitions
#include "template.c" //at very end of template.h
template.c-
//definitions