On Apr 9, 2005, at 8:12 PM, qyang@cs.ucr.edu wrote:
EdgeDescriptor Edge; Edge = *(edges(G).first + n); //n is an int remove_edge(Edge, G); ==================================================
I got compilation errors at line "Edge = *(edges(G).first + n);".
I have to use the following code in order to compile the code and to run it correctly: ================================================== //typedef stuff ...
EdgeDescriptor Edge; EdgeIterator edge_iter; edge_iter = edges(G).first; for(int i = 0; i < n; i++) { edge_iter++;} Edge = *edge_iter; remove_edge(Edge, G); ==================================================
Basically, you have to use a for() loop to increment the edge_iterator varialbe. Is it possible just to use one addition(the first code) instead of n additions(the second code) to increment the iterator?
Not in general. You can use std::advance(edge_iter, n); to move edge_iter forward n steps. Doug