This is the mail archive of the
egcs-bugs@egcs.cygnus.com
mailing list for the EGCS project.
Re: STL iterator problem (egcs-1.1.2)
- To: Chris Rankin <rankinc@zip.com.au>
- Subject: Re: STL iterator problem (egcs-1.1.2)
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 03 Jul 1999 14:43:44 -0300
- Cc: egcs-bugs@egcs.cygnus.com
- References: <377D79E6.BE8A3DB1@zipworld.com.au>
On Jul 2, 1999, Chris Rankin <rankinc@zip.com.au> wrote:
> I hope that this is a minor problem, what with the gcc release just
> around the corner.
> The included program does not compile:
After adding a closing bracket for main, it only complains about:
teststl.cpp: In function `int main()':
teststl.cpp:23: no match for `reverse_iterator<const int *> & !=
reverse_iterator<int *>'
Which is indeed correct. It may be regarded as an STL problem, and so
it might be fixed in the next import of SGI STL, or the problem should
be reported to the maintainers of SGI STL, which we simply
re-distribute. In order to avoid this problem, instead of writing:
> NumberCollection::const_reverse_iterator riter;
> for (riter = num_collect.rbegin();
> riter != num_collect.rend();
> ++riter)
> {
I write:
for (NumberCollection::const_reverse_iterator riter=..., eiter=...end();
riter != eiter; ++riter) ...
which compiles fine.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists