graph vertices / IRIX / GCC
Hello,
Q: one can construct a graph using adjacency_list<> and then immediately
iterate over the vertices, right?
The program below writes out the numbers 0 to 9 when compiled using
gcc 3.2 on linux. Ditto on my IRIX system, *unless* I try to
optimize. I expect this is a GCC optimizer bug, but I just want to be
sure I haven't overlooked something in the boost docs.
Thanks,
-S
#include <iostream>
#include
Graph;
typedef boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor; typedef boost::graph_traits<Graph>::edge_descriptor edge_descriptor; int main() { Graph g( 10 ); boost::graph_traits<Graph>::vertex_iterator ui, ui_end; for (boost::tie(ui, ui_end) = boost::vertices(g); ui != ui_end; ++ui) { std::cout << "*ui = " << *ui << std::endl; } return 0; }
What you are doing looks right. So there's probably a bug somewhere...
On Sun, 15 Sep 2002 yg-boost-users@gmane.org wrote:
yg-boo> Hello,
yg-boo>
yg-boo> Q: one can construct a graph using adjacency_list<> and then immediately
yg-boo> iterate over the vertices, right?
yg-boo>
yg-boo> The program below writes out the numbers 0 to 9 when compiled using
yg-boo> gcc 3.2 on linux. Ditto on my IRIX system, *unless* I try to
yg-boo> optimize. I expect this is a GCC optimizer bug, but I just want to be
yg-boo> sure I haven't overlooked something in the boost docs.
yg-boo>
yg-boo> Thanks,
yg-boo> -S
yg-boo>
yg-boo>
yg-boo> #include <iostream>
yg-boo>
yg-boo> #include
participants (2)
-
Jeremy Siek
-
yg-boost-users@m.gmane.org