From b6d8de4cf97b36a032d8fe42a2c5529df13b9b9d Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Fri, 18 May 2001 22:49:44 +0000 Subject: [PATCH] fixed some get color compare issues [SVN r10140] --- include/boost/graph/depth_first_search.hpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/boost/graph/depth_first_search.hpp b/include/boost/graph/depth_first_search.hpp index 193ba43c..913616e4 100644 --- a/include/boost/graph/depth_first_search.hpp +++ b/include/boost/graph/depth_first_search.hpp @@ -79,10 +79,11 @@ namespace boost { typename graph_traits::out_edge_iterator ei, ei_end; for (tie(ei, ei_end) = out_edges(u, g); ei != ei_end; ++ei) { vis.examine_edge(*ei, g); - if (get(color, target(*ei, g)) == Color::white()) { + ColorValue v_color = get(color, target(*ei, g)); + if (v_color == Color::white()) { vis.tree_edge(*ei, g); depth_first_visit_impl(g, target(*ei, g), vis, color); - } else if (get(color, target(*ei, g)) == Color::gray()) + } else if (v_color == Color::gray()) vis.back_edge(*ei, g); else vis.forward_or_cross_edge(*ei, g); @@ -104,17 +105,20 @@ namespace boost { put(color, *ui, Color::white()); vis.initialize_vertex(*ui, g); } - for (tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) - if (get(color, *ui) == Color::white()) { + for (tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) { + ColorValue u_color = get(color, *ui); + if (u_color == Color::white()) { vis.start_vertex(*ui, g); detail::depth_first_visit_impl(g, *ui, vis, color); } + } } template struct dfs_dispatch { - template + template static void apply(const VertexListGraph& g, DFSVisitor vis, const bgl_named_params& params, @@ -151,7 +155,8 @@ namespace boost { depth_first_search(const VertexListGraph& g, const bgl_named_params& params) { - typedef typename property_value< bgl_named_params, vertex_color_t>::type C; + typedef typename property_value< bgl_named_params, + vertex_color_t>::type C; detail::dfs_dispatch::apply (g, choose_param(get_param(params, graph_visitor),