delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/24/22:00:58

From: ryot AT bigfoot DOT com (George Ryot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Templates? What templates?
Message-ID: <37ed04ed.4818379@news.clara.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990923112447 DOT 10652b-100000 AT is> <7sgp47$svt$1 AT vixen DOT cso DOT uiuc DOT edu>
X-Newsreader: Forte Agent 1.5/32.452
X-No-Archive: yes
MIME-Version: 1.0
Lines: 48
Date: Fri, 24 Sep 1999 23:20:13 GMT
NNTP-Posting-Host: 195.8.91.246
X-Complaints-To: abuse AT clara DOT net
X-Trace: nnrp4.clara.net 938215213 195.8.91.246 (Sat, 25 Sep 1999 00:20:13 BST)
NNTP-Posting-Date: Sat, 25 Sep 1999 00:20:13 BST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> in my array.h file:
> 
> template<class Etype>
> class Array
> {
> public:
>    Array(void);
> 
> private:
>    Etype y;
> };
> 
> in array.C:
> 
> #include "array.h"
> 
> template<class Etype>
> Array<Etype>::Array(void)
> {
>    y = 0;
> }
> 
> in main.C:
> 
> #include "array.h"
> 
> int main(void)
> {
> Array<int> x;
> 
> return 0;
> }

Try moving the template definition from array.C to array.h

Did you test this with CC?

> >> When is g++ gonna support the standard?
> >
> >AFAIK, g++ supports the standard.  Please post sample code that is
> >accepted by CC (on what platform, btw? CC doesn't tell anything about the
> >machine and the OS) but rejected by g++.
> >
> >Also, what version of g++ are you using?

-- 
george

- Raw text -


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