Boost logo

Boost Users :

From: Jeremy Graham Siek (jsiek_at_[hidden])
Date: 2005-07-12 18:25:35


Hi Doug,

Yeah, you're right... I didn't read that loop carefully... I assumed
it was doing the usual thing.

Cheers,
Jeremy

On Jul 12, 2005, at 4:06 PM, Doug Gregor wrote:
> On Jul 12, 2005, at 8:52 AM, Jeremy Graham Siek wrote:
>> On Jul 12, 2005, at 8:25 AM, Douglas Gregor wrote:
>>> while (vertices(databaseGraph).first !=
>>> vertices(databaseGraph).second)
>>> {
>>> b = *vertices(databaseGraph).first;
>>> clear_vertex(b, databaseGraph);
>>> remove_vertex(b, databaseGraph);
>>> }
>>
>> But the above loop could also have problems due to vertex iterator
>> invalidation
>> caused by remove_vertex... it depends on the graph used.
>
> ?
>
> We're not storing any iterators, so there's nothing to invalidate.
> Granted, the loop is horribly inefficient when VertexListS=vecS, and
> clear() is better, but this will work.
>
> Doug
_______________________________________________
Jeremy Siek <jsiek_at_[hidden]>
http://www.osl.iu.edu/~jsiek
Ph.D. Candidate, Indiana University Bloomington
C++ Booster (http://www.boost.org)
_______________________________________________


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