www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/30/18:26:54

From: alainm AT news DOT RISQ DOT QC DOT CA (Alain Magloire)
Subject: Re: problem using "templates"
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991230155042 DOT 1790D-100000 AT is>
X-Newsreader: TIN [version 1.2 PL2]
Lines: 41
Message-ID: <viRa4.6159$36.52788@carnaval.risq.qc.ca>
Date: Thu, 30 Dec 1999 22:47:55 GMT
NNTP-Posting-Host: 132.206.63.174
X-Complaints-To: abuse AT mcgill DOT ca
X-Trace: carnaval.risq.qc.ca 946594075 132.206.63.174 (Thu, 30 Dec 1999 17:47:55 EST)
NNTP-Posting-Date: Thu, 30 Dec 1999 17:47:55 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:

: On Thu, 30 Dec 1999, Adam Maj wrote:

: > How can I fix this bug ? Maybe there is (or will be) new version of GNU
: > (or DJGPP) ?
: > I am using version 202

: I don't have any idea whether this is a bug in the compiler or in
: your code, but in any case you need to state the version of the
: compiler (printed when you type "gcc --version"), not the version
: of DJGPP.  The compiler is not part of the core DJGPP distribution,
: it is a port of GCC, and thus shares its bugs.

Think, Eli's right , this compile and run fine with my version of gcc :

% cat z.cc
#include <iostream.h>

template <class ccc> class my_class {
     public :
        static char* str;
};
    
template <class ccc> char* my_class<ccc>::str="abc";
    
int main()
{
   cerr << my_class<int>::str << endl;
}                                         
% make z
g++     z.cc   -o z
% ./z 
abc
% gcc --version
2.95.1                              

--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

- Raw text -


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