C++ templates

Florian Wiesner wiesner at informatik.tu-muenchen.de
Fri Nov 17 10:24:23 GMT 2000


Benjamin Ellis wrote:
> 
> On Thursday 16 November 2000 05:00 pm, you wrote:
> > I as far as I know, templates can't be split up into header and source
> > files... the template class and implementation must exist in one unit (i.e.
> > a header file).  This is required by the compiler.  I have never been able
> > to successfully split up a template class into two units.
> >
> >
> 
> works fine for me, i do it all the time, and i explained how
> 
> -ben
> 
> -
> to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
> unsubscribe »your-email-address«


Thx,     :)

I didn't know that I have to use the template keyword again...

I've tried to write something like this:

myClass.hpp
--------------------------

template <class T> class myClass {
public:
  myClass (T param);
}

myClass.cpp
--------------------------
// no "template" used here!
myClass<class T>::myClass (T param) {
...
}

I think that was the fault. It's working now... :)

-Florian
 
--------------------------------------------------------------
Florian Wiesner
wiesner at informatik.tu-muenchen.de

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list