Mail Archives: djgpp/1998/01/07/04:30:24
On 7 Jan 98 01:28:02 GMT, "Robert Lazorko" <rlazorko AT geocities DOT com>
wrote:
>I am having trouble compiling using templates - although all of my code
>syntax is C++ compatible. I have reason to believe that the compiler may
>require some special instructions for using templates. If any one has any
>help or ideas, please mail me.
>
>Thanks in advance!
The way I do template classes is as follows:
in myclass.h:
#ifndef A_H
#define A_H
template< class T >class A
{
public:
A();
};
#ifndef A_IMPLEMENTATION
#define A_IMPLEMENTATION
#include "A.cc"
#endif // A_IMPLEMENTATION
#endif // A_H
in myclass.cc:
template< class T >
A< T >::A()
{
};
A few points... don't include the .cc file in your project, and don't
include the .h file in the .cc file.
Cheers,
MooBen
Programmer for some people I can't quite remember
"Winnie says he's *Not* In-Animate"
- Raw text -