I have gotten this to work before.  But it's quirky, what you have to do is
include the header file and C++ file in the include statement of the file
where you plan to use the template.  For example, you define a template.h
and a template.cpp, in order to use the template and not get errors I had
to:

#include "template.h"
#include "template.cpp"

.....

This resolved the issue, however it must be included anywhere that you use a
template.  Be careful about globals though.
----- Original Message -----
From: "Scott L. Johnson" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2000 12:57 AM
Subject: RE: [C++] CW doesn't support member function templates outside cl
ass body?


> > From: Jaison Lee [mailto:[EMAIL PROTECTED]]
> > The proper form for a member function template would be:
> >     template <class T>
> >     void ObjectStream::WriteObject<T> ( const T & obj ) { /* ... */ }
> > with the T after the function name as well as before the
> > function header.
>
> Thanks, and you're right.  That was actually a typo in my email; I did try
> it with <T> in the right place, which didn't work.
>
> > whether or not your compiler will let you use them is completely
> > dependent on when it was made.
> > if you find that you can't do it take solace in the fact that
> > many other before you have run up against this as well. :)
>
> That appears to be the case here.  And it's easy to find some of those
"many
> other" people with various other compilers (including latest from
> Microsoft) in a quick search in the Deja news archive.
>
> -slj-
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
>
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to