Thomas Grill schrieb:
are you sure the gcc compiler can handle template code to be compiled in separate object files? I would try to include the TPDContainer.cpp into TPDContainer.h, just as
for
NT defined. (line 122)
I tried this, but then I get all the errors like "redifinition of ..." for each method!
But yesterday I rethought the whole design and I think I'll make it without templates, because I don't have much advantages from them anyhow in my case. And then there are no problems with all the compilers ...
But thanks for your efforts, LG Georg
are you sure the gcc compiler can handle template code to be compiled in separate object files? I would try to include the TPDContainer.cpp into TPDContainer.h, just as
for
NT defined. (line 122)
I tried this, but then I get all the errors like "redifinition of ..." for each method!
I'm not sure why this happens - i'm using templates all the time, and i find the easiest solution to write all the implementations inside the class declaration, like in
template<class T> class hula { public: hula(): a(0) {} T plus(T b) { return a+b; } private: T a; };
all the best, Thomas
moin all,
On 13 October 2004 at 11:39:47, Thomas Grill appears to have written:
I'm not sure why this happens - i'm using templates all the time, and i find the easiest solution to write all the implementations inside the class declaration, like in
template<class T> class hula { public: hula(): a(0) {} T plus(T b) { return a+b; } private: T a; };
as far as i know, you *have* to do it this way with templates; that's why the STL is all header files...
marmosets, Bryan