www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/07/13:00:32

From: "J.A. Bijsterbosch" <bijster AT worldonline DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Templates, Classes, Friends & DJGPP 2.01
Date: 7 Apr 1998 16:42:04 GMT
Organization: World Online
Lines: 58
Message-ID: <01bd6205$d506e7c0$LocalHost@default>
References: <OPACMBMALOKEAAAA AT mailexcite DOT com>
NNTP-Posting-Host: asd2-p97.worldonline.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello Sed,

Sed Johnson <oplop AT mailexcite DOT com> schreef in artikel
<OPACMBMALOKEAAAA AT mailexcite DOT com>...
> 
> Hello,
> 
> I recently upgraded from DJGPP 2.00 to 2.01, I 
> upgraded from GPP/LGPP272 to GPP/LGPP280, etc.

Hmm, haven't yet but will do. <g>

> Since I've upgraded my DJGPP though, I get several
> errors on compilation.  I searched through the FAQ
> and the inf files and could not find anything that
> I was doing wrong.  Here is a bit of the code that
> is causing errors:
> 
> .....
>   template <class T> class Node
>   {
>       friend Iter<T>;
>       friend List<T>;
>    private:
> .....
> 
> Iter and List are classes which are described
> after this class. 

Shouldn't you have the declarations for Iter<T> and List<T> before your
Node class?
Try what happens if you put the following lines before class Node in your
code:

template<class T> class Iter;
template<class T> class List;

> There are also a few other errors I get too, but I
> think if someone could help me understand why I'm getting errors now,
after it worked
> perfectly before, I
> can figure out the rest.  
> 
> Any ideas why this code is longer is working, please? 

Personally I'm supprised it worked anyhow if your source was as you
described. 
If the definitions of Iter<T> and List<T> come after the Node class they
don't exist as far as the compiler is concerned, unless you declare them
before Node. After that it isn't important where the definition resides.

-- 
Greetings from sunny Amsterdam

                Jan

email: bijster AT worldonline DOT nl
http://home.worldonline.nl/~bijster

- Raw text -


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