Modify

Opened 6 years ago

Closed 6 years ago

#6371 closed Bugs (fixed)

[graph] compile error directed_graph/undirected_graph

Reported by: Akira Takahashi <faithandbrave@…> Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

follow code is compile error:

#include <boost/graph/directed_graph.hpp>
#include <boost/graph/undirected_graph.hpp>

using namespace boost;

int main()
{
    directed_graph<> dg(5);
    graph_traits<directed_graph<> >::vertex_descriptor
        dv = vertex(3, dg); // error!

    undirected_graph<> ug(5);
    graph_traits<undirected_graph<> >::vertex_descriptor
        uv = vertex(3, ug); // error!

    return 0;
}

patch is here:

--- directed_graph.hpp
+++ directed_graph.hpp (bug fixed)
@@ -410,7 +410,7 @@
 typename DIRECTED_GRAPH::vertex_descriptor
 vertex(typename DIRECTED_GRAPH::vertices_size_type n,
        DIRECTED_GRAPH const& g)
-{ return vertex(g.impl()); }
+{ return vertex(n, g.impl()); }
--- undirected_graph.hpp
+++ undirected_graph.hpp (bug fixed)
@@ -413,7 +413,7 @@
 typename UNDIRECTED_GRAPH::vertex_descriptor
 vertex(typename UNDIRECTED_GRAPH::vertices_size_type n,
        UNDIRECTED_GRAPH const& g)
-{ return vertex(g.impl()); }
+{ return vertex(n, g.impl()); }

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by Jeremiah Willcock

Resolution: fixed
Status: newclosed

(In [76394]) Applied patch from #6371; fixes #6371

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeremiah Willcock.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.