Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77736 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2012-04-03 01:49:37


Author: jewillco
Date: 2012-04-03 01:49:36 EDT (Tue, 03 Apr 2012)
New Revision: 77736
URL: http://svn.boost.org/trac/boost/changeset/77736

Log:
Added no-named-parameter version and simplified code
Text files modified:
   trunk/boost/graph/depth_first_search.hpp | 15 +++++++++------
   1 files changed, 9 insertions(+), 6 deletions(-)

Modified: trunk/boost/graph/depth_first_search.hpp
==============================================================================
--- trunk/boost/graph/depth_first_search.hpp (original)
+++ trunk/boost/graph/depth_first_search.hpp 2012-04-03 01:49:36 EDT (Tue, 03 Apr 2012)
@@ -289,7 +289,7 @@
       template <typename Graph, typename ArgPack>
       struct depth_first_search_impl {
         typedef void result_type;
- void operator()(const Graph& g, const ArgPack& arg_pack) {
+ void operator()(const Graph& g, const ArgPack& arg_pack) const {
           using namespace boost::graph::keywords;
           boost::depth_first_search(g,
                                     arg_pack[_visitor | make_dfs_visitor(null_visitor())],
@@ -307,16 +307,19 @@
   depth_first_search(const VertexListGraph& g,
                      const bgl_named_params<P, T, R>& params)
   {
- typedef typename boost::graph_traits<VertexListGraph>::vertex_iterator vi;
- std::pair<vi, vi> verts = vertices(g);
- if (verts.first == verts.second)
- return;
- using namespace boost::graph::keywords;
     typedef bgl_named_params<P, T, R> params_type;
     BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params)
     boost::graph::depth_first_search_with_named_params(g, arg_pack);
   }
 
+ template <class VertexListGraph>
+ void
+ depth_first_search(const VertexListGraph& g)
+ {
+ BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(no_named_parameters, no_named_parameters())
+ boost::graph::depth_first_search_with_named_params(g, arg_pack);
+ }
+
   template <class IncidenceGraph, class DFSVisitor, class ColorMap>
   void depth_first_visit
     (const IncidenceGraph& g,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk