diff --git a/boost/graph/named_graph.hpp b/boost/graph/named_graph.hpp index 1150e43..4c687a0 100644 --- a/boost/graph/named_graph.hpp +++ b/boost/graph/named_graph.hpp @@ -11,16 +11,23 @@ #define BOOST_GRAPH_NAMED_GRAPH_HPP #include -#include -#include -#include -#include +#include +#include +#include #include #include +#include #include +#include // for boost::lookup_one_property #include +#include // for boost::make_tuple +#include +#include +#include #include +#include // for std::equal_to #include // for std::runtime_error +#include // for std::pair namespace boost { namespace graph { @@ -410,6 +417,35 @@ add_edge(typename BGL_NAMED_GRAPH::vertex_name_type const& u_name, g.derived()); } +// Overloads to support EdgeMutablePropertyGraph graphs +template +std::pair::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::type const& p, + BGL_NAMED_GRAPH& g) { + return add_edge(u, add_vertex(v_name, g.derived()), p, g.derived()); +} + +template +std::pair::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::type const& p, + BGL_NAMED_GRAPH& g) { + return add_edge(add_vertex(u_name, g.derived()), v, p, g.derived()); +} + +template +std::pair::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::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