mirror of
https://github.com/boostorg/graph.git
synced 2026-02-01 08:32:11 +00:00
Removed dead code/comment block from iteration macros.
This commit is contained in:
@@ -17,45 +17,6 @@
|
||||
#define BGL_FIRST(linenum) (BGL_RANGE(linenum).first)
|
||||
#define BGL_LAST(linenum) (BGL_RANGE(linenum).second)
|
||||
|
||||
/*
|
||||
BGL_FORALL_VERTICES_T(v, g, graph_t) // This is on line 9
|
||||
expands to the following, but all on the same line
|
||||
|
||||
for (typename boost::graph_traits<graph_t>::vertex_iterator
|
||||
bgl_first_9 = vertices(g).first, bgl_last_9 = vertices(g).second;
|
||||
bgl_first_9 != bgl_last_9; bgl_first_9 = bgl_last_9)
|
||||
for (typename boost::graph_traits<graph_t>::vertex_descriptor v;
|
||||
bgl_first_9 != bgl_last_9 ? (v = *bgl_first_9, true) : false;
|
||||
++bgl_first_9)
|
||||
|
||||
The purpose of having two for-loops is just to provide a place to
|
||||
declare both the iterator and value variables. There is really only
|
||||
one loop. The stopping condition gets executed two more times than it
|
||||
usually would be, oh well. The reason for the bgl_first_9 = bgl_last_9
|
||||
in the outer for-loop is in case the user puts a break statement
|
||||
in the inner for-loop.
|
||||
|
||||
The other macros work in a similar fashion.
|
||||
|
||||
Use the _T versions when the graph type is a template parameter or
|
||||
dependent on a template parameter. Otherwise use the non _T versions.
|
||||
|
||||
-----------------------
|
||||
6/9/09 THK
|
||||
|
||||
The above contains two calls to the vertices function. I modified these
|
||||
macros to expand to
|
||||
|
||||
for (std::pair<typename boost::graph_traits<graph_t>::vertex_iterator,
|
||||
typename boost::graph_traits<graph_t>::vertex_iterator> bgl_range_9 = vertices(g);
|
||||
bgl_range_9.first != bgl_range_9.second;
|
||||
bgl_range_9.first = bgl_range_9.second)
|
||||
for (typename boost::graph_traits<graph_t>::vertex_descriptor v;
|
||||
bgl_range_9.first != bgl_range_9.second ? (v = *bgl_range_9.first, true) : false;
|
||||
++bgl_range_9.first)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#define BGL_FORALL_VERTICES_T(VNAME, GNAME, GraphType) \
|
||||
for (std::pair<typename boost::graph_traits<GraphType>::vertex_iterator, \
|
||||
|
||||
Reference in New Issue
Block a user