From 8224418763973729437
X-Google-Thread: f78e5,a3fedf78e9f45f2e
X-Google-Thread: 109fba,a3fedf78e9f45f2e
X-Google-Thread: fc772,a3fedf78e9f45f2e
X-Google-Attributes: gidf78e5,gid109fba,gidfc772,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed1.sea.pnap.net!newsfeed2.sea.pnap.net!newsfeed.pnap.net!brmea-news-1.sun.com!news1nwk.sfbay.sun.com!taumet!clamage
From: llewelly <llewelly.at@xmission.dot.com>
Newsgroups: comp.std.c++,comp.lang.c++,comp.lang.c++.moderated
Subject: Re: Porting code, need guidance,  Thx
Date: Mon, 16 Aug 2004 19:56:04 +0000 (UTC)
Organization: The Illusory Sorting Algorithm
Lines: 75
Sender: cppmods@netlab.cs.rpi.edu
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <867jrzwxq9.fsf@Zorthluthik.local.bar>
References: <10hni00f7iqhm59@corp.supernews.com>
NNTP-Posting-Host: taumet.sfbay.sun.com
X-Trace: news1nwk.SFbay.Sun.COM 1092686164 2222 129.146.79.208 (16 Aug 2004 19:56:04 GMT)
X-Complaints-To: usenet@news1nwk.sfbay.sun.com
NNTP-Posting-Date: Mon, 16 Aug 2004 19:56:04 +0000 (UTC)
Delivered-to: std-c++@ucar.edu
X-Original-Date: Sun, 15 Aug 2004 21:47:10 -0600
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
 iQBVAwUAQSEPwUHMCo9UcraBAQGieQH9FgF9UXei5eGMlDut/Hyhsn8m4Mb+GerI
  7M/QRI06d61By5JjN0peQ8pLVAd7hoh6gq3I1UaZO026BdH5wW656A==                =HkcV
X-Approved-For-Group: kuehl@inf.uni-konstanz.de comp.lang.c++.moderated
X-NNTP-posting-host: netlab.cs.rpi.edu
Original-recipient: rfc822;stephen.clamage@sun.com
Originator: clamage@taumet
Xref: g2news1.google.com comp.std.c++:1747 comp.lang.c++:17302 comp.lang.c++.moderated:6227


Kenton Groombridge <kgroombr@REMOVEMEcharter.net> writes:

> Hi,
> I previous posted this in a gcc and g++ groups since that is the
> compiler I am working with, but I didn't get any response.
>
> Hopefully these are the right groups for this question.  I am working
> (actually playing) on porting Alien vs Predator to Linux.  I am using
> the code that is available via CVS from icculus.org.
>
> I recently upgraded my gcc to 3.4.1 and now a portion of the code
> doesn't compile.  Nothing in the code has changed.

g++ 3.4 implements two-phase lookup as required by the 1998
    standard. That makes it in some degree source-code incompatible
    with g++ 3.x .

You can find examples on the gcc website; see the 'C++' section of:
    http://gcc.gnu.org/gcc-3.4/changes.html

> I think I figured it out, but want to be sure before I spend a bunch of
> time working around it only to find that I was wrong.
>
> My guess is the class ConstIterator makes class Iterator a friend,

This is true but irrevelant. Friendship affects access control, not
    namelookup. No declaration for 'nEntriesRemaining' is found,
    therefor the issue is namelookup. This is in fact akin to one of
    the examples on the gcc 3.4 changes page I linked to above.

> but
> class Iterator is a derived class of the bass class ConstIterator (hope
> I said that right).

Correct. 

> From what I understand and have researched is that
>   in order for the class ConstIterator to use the class Iterator as a
> friend, then class Iterator has to be defined first,

A definition is *not* necessary. Only a forward declaration is
    necessary - and in some cases the friend declaration itself can
    fulfill this purpose. But the whole friend issue is irrevelant.

> and for class
> Iterator to be derived from class ConstIterator, then the class
> ConstIterator has to be defined first.

True.

> Essentially a catch 22.

No, becuase declaring something friend does not require a definition
    - but, as I said before, the whole friend issue is irrevelant.

[snip]
> I would like to know how you would
> approach the fix for this.
[snip]

Replace 'nEntriesRemaining' whith 'this->nEntriesRemaining'.

The Vandervoode and Josuttis _C++ Templates_ book has a section on
    dependent names which I think explains why this works.


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



