This is the mail archive of the egcs-bugs@egcs.cygnus.com mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: STL iterator problem (egcs-1.1.2)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]