Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81772 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2012-12-07 14:41:02


Author: jewillco
Date: 2012-12-07 14:41:01 EST (Fri, 07 Dec 2012)
New Revision: 81772
URL: http://svn.boost.org/trac/boost/changeset/81772

Log:
Applied patch from #7766; fixes #7766
Text files modified:
   trunk/boost/graph/named_graph.hpp | 44 ++++++++++++++++++++++++++++++++++++---
   1 files changed, 40 insertions(+), 4 deletions(-)

Modified: trunk/boost/graph/named_graph.hpp
==============================================================================
--- trunk/boost/graph/named_graph.hpp (original)
+++ trunk/boost/graph/named_graph.hpp 2012-12-07 14:41:01 EST (Fri, 07 Dec 2012)
@@ -11,16 +11,23 @@
 #define BOOST_GRAPH_NAMED_GRAPH_HPP
 
 #include <boost/config.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/multi_index_container.hpp>
+#include <boost/functional/hash.hpp>
+#include <boost/graph/graph_traits.hpp>
+#include <boost/graph/properties.hpp>
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/member.hpp>
+#include <boost/multi_index_container.hpp>
 #include <boost/optional.hpp>
+#include <boost/pending/property.hpp> // for boost::lookup_one_property
 #include <boost/throw_exception.hpp>
+#include <boost/tuple/tuple.hpp> // for boost::make_tuple
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 #include <boost/utility/enable_if.hpp>
+#include <functional> // for std::equal_to
 #include <stdexcept> // for std::runtime_error
+#include <utility> // for std::pair
 
 namespace boost { namespace graph {
 
@@ -410,6 +417,35 @@
                   g.derived());
 }
 
+// Overloads to support EdgeMutablePropertyGraph graphs
+template <BGL_NAMED_GRAPH_PARAMS>
+std::pair<typename graph_traits<Graph>::edge_descriptor, bool>
+add_edge(typename BGL_NAMED_GRAPH::vertex_descriptor const& u,
+ typename BGL_NAMED_GRAPH::vertex_name_type const& v_name,
+ typename edge_property_type<Graph>::type const& p,
+ BGL_NAMED_GRAPH& g) {
+ return add_edge(u, add_vertex(v_name, g.derived()), p, g.derived());
+}
+
+template <BGL_NAMED_GRAPH_PARAMS>
+std::pair<typename graph_traits<Graph>::edge_descriptor, bool>
+add_edge(typename BGL_NAMED_GRAPH::vertex_name_type const& u_name,
+ typename BGL_NAMED_GRAPH::vertex_descriptor const& v,
+ typename edge_property_type<Graph>::type const& p,
+ BGL_NAMED_GRAPH& g) {
+ return add_edge(add_vertex(u_name, g.derived()), v, p, g.derived());
+}
+
+template <BGL_NAMED_GRAPH_PARAMS>
+std::pair<typename graph_traits<Graph>::edge_descriptor, bool>
+add_edge(typename BGL_NAMED_GRAPH::vertex_name_type const& u_name,
+ typename BGL_NAMED_GRAPH::vertex_name_type const& v_name,
+ typename edge_property_type<Graph>::type const& p,
+ BGL_NAMED_GRAPH& g) {
+ return add_edge(add_vertex(u_name, g.derived()),
+ add_vertex(v_name, g.derived()), p, g.derived());
+}
+
 #undef BGL_NAMED_GRAPH
 #undef BGL_NAMED_GRAPH_PARAMS
 


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