delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/11/07:34:42

From: DavMac AT iname DOT com (Davin McCall)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More template problems (C++)
Date: Mon, 11 Oct 1999 08:52:42 GMT
Organization: Monash Uni
Lines: 46
Distribution: world
Message-ID: <3801a4ef.858850@newsserver.cc.monash.edu.au>
References: <7tp5ti$sp0$2 AT vixen DOT cso DOT uiuc DOT edu>
NNTP-Posting-Host: damcc5.halls.monash.edu.au
X-Trace: towncrier.cc.monash.edu.au 939631909 4762 130.194.198.138 (11 Oct 1999 08:51:49 GMT)
X-Complaints-To: abuse AT monash DOT edu DOT au
NNTP-Posting-Date: 11 Oct 1999 08:51:49 GMT
X-Newsreader: Forte Free Agent 1.1/32.230
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've noted the problem in the quoting below.

On Sat, 9 Oct 1999 23:54:04 -0500, "Al Combs" <acombs AT uiuc DOT edu> wrote:

>Ok, I know I've been here before with template problems, and now I need
>specific help again to understand how templates work in DJGPP (G++). Here is
>my code:
>
>*** foo.h
>template<class Etype>
>class Foo
>{
>public:
>  void Replace();
>};
>
>
>***foo.C
>#include "foo.h"
>
>template<class Etype>
>void Replace()
>{}

That should have been:

template <class Etype>
void Foo<T>::Replace()
{}


>
>***main.C
>#include "foo.h"
>
>main()
>{
>  Foo<int> hi;
>  hi.Replace();
>}
>
>

__________________________________________________________
       *** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019