Re: [Dev-C++] Template member function (C++ obviously)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Hossein H. <ult...@em...> - 2003-07-27 15:35:33
|
Dear Paul,
> I hope anyone can help me, cause I'm starting to consider making the
> entire class a template, just to get rid of the linker error. I already
> switched from Visual C++ 6 to GCC because of one of the many bugs in
> VC++6, one of which is that it doesn't seem to understand/support
> template member functions.
Oh, yes! Member templatisation is one of the C++ features that the
nasty MSVC++6 doesn't supports. One of bewildering (known) bugs of it!
That's whilst member templatatisation is completely Standard-compliant,
and that's a shame, out of thousands, for MSVC++6!
Hmmm... One point more: I know that you told the error is engendered by
the linker, but consider the following peice of code which I site
directly from TC++PL:Spec (Section C.13.6):
class Memory{
public:
template<class T> T* get_new();
template<class T> void release(T&);
};
template<class Allocator> void f(Allocator& m)
{
int* p1 = m.get_new<int>();
//Syntax Error: int after less than operator
int* p2 = m.template get_new<int>();
//explicit qualification
//...
m.release(p1);
//template argument deduced: no explicit qualification needed
m.release(p2);
}
Are you sure that's not arisen because of forgetting the "template
qualifier?"
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|