Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL defining my own iterator?
From: Anders Wallin (anders.e.e.wallin_at_[hidden])
Date: 2011-12-27 04:58:06


> In your second test, begin and end have the same edge, so they compare equal
> using your iterator's == operator, breaking the loop immediately. Does the
> do loop you use in your first test case work with iterators?  If so, you
> will need some special-case way to create an end iterator; I know
> Boost.Intrusive has a circular linked list class (slist), so checking that
> code might show how to set up the iterators.

I now got both a do-while and a BOOST_FOREACH loop working, but only
when building in debug mode.
When built in release mode (NDEBUG and -O3) I the iterator gives
incorrect results in both cases.
Output along with a compilation warning is here: http://pastebin.ca/2096568

updated code is here:
https://github.com/aewallin/sandbox/blob/master/bgl_iterator/main.cpp

what causes this difference in behaviour with NDEBUG and -O3 ?

thanks,
AW


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net