|
Boost Users : |
Subject: Re: [Boost-users] MultiPassInputIterator concept
From: Tim Keitt (tkeitt_at_[hidden])
Date: 2008-11-22 15:23:20
David Abrahams <dave <at> boostpro.com> writes:
> I don't think any code is relying on the 2nd case, but it's hard to be
> sure. You could check for it by adding a generation counter in the
> iterator and assert if two iterators from different generations are
> compared. After all, they are effectively iterating different
> sequences.
>
I found a case where the second condition is required.
Its in push_relabel_max_flow:
while (1) {
out_edge_iterator ai, ai_end;
for (ai = current[u], ai_end = out_edges(u, g).second;
ai != ai_end; ++ai) {
edge_descriptor a = *ai;
current is an vector of edge iterators. Notice the call to out_edges.
This should be relatively easy to fix by storing the end iterators as
well as the current iterator.
THK
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