Boost C++ Libraries: Ticket #1021: [Graph][reverse_graph] Problem using reverse_graph adapter with an adapted user defined graph https://svn.boost.org/trac10/ticket/1021 <p> I have had some difficulty using the current version of the reverse_graph adapter on the Boost Graph Library. It seems to require the class being reversed to have types that a user class that has been adapted using graph_traits et al may not have. I have attached an example that shows the problem which includes comments to describe what I think the problem is. I have also attached a modified version of reverse_graph.hpp that works with this example. </p> <p> -Tony </p> <p> Attached files: </p> <p> bug_report_example_skeleton.hpp An include file the contains a minimal user defined graph <a class="missing wiki">MyGraph</a> together with the required interfaces to adapt it to be a Boost Graph. </p> <p> bug_report_example_reverse_graph.cpp An example showing the problems encountered with the current reverse_graph.hpp </p> <p> reverse_graph.hpp An altered version of reverse_graph.hpp that works with the example. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1021 Trac 1.4.3 anonymous Thu, 31 May 2007 19:01:41 GMT attachment set https://svn.boost.org/trac10/ticket/1021 https://svn.boost.org/trac10/ticket/1021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bug_report_example_skeleton.hpp</span> </li> </ul> Ticket anonymous Thu, 31 May 2007 19:02:31 GMT attachment set https://svn.boost.org/trac10/ticket/1021 https://svn.boost.org/trac10/ticket/1021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bug_report_example_reverse_graph.cpp</span> </li> </ul> Ticket anonymous Thu, 31 May 2007 19:02:55 GMT attachment set https://svn.boost.org/trac10/ticket/1021 https://svn.boost.org/trac10/ticket/1021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">reverse_graph.hpp</span> </li> </ul> Ticket Eric Niebler Wed, 11 Jul 2007 01:54:17 GMT owner set https://svn.boost.org/trac10/ticket/1021#comment:1 https://svn.boost.org/trac10/ticket/1021#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">doug_gregor</span> </li> </ul> Ticket Douglas Gregor Tue, 29 Apr 2008 18:29:51 GMT owner changed https://svn.boost.org/trac10/ticket/1021#comment:2 https://svn.boost.org/trac10/ticket/1021#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">doug_gregor</span> to <span class="trac-author">Douglas Gregor</span> </li> </ul> Ticket Jeremiah Willcock Wed, 13 May 2009 23:03:29 GMT owner, status changed https://svn.boost.org/trac10/ticket/1021#comment:3 https://svn.boost.org/trac10/ticket/1021#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Jeremiah Willcock Tue, 24 Nov 2009 20:17:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1021#comment:4 https://svn.boost.org/trac10/ticket/1021#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57902" title="Fixed uses of undocumented members of graph types; fixes #1021; fixes #2072">[57902]</a>) Fixed uses of undocumented members of graph types; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1021" title="#1021: Bugs: [Graph][reverse_graph] Problem using reverse_graph adapter with an ... (closed: fixed)">#1021</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2072" title="#2072: Bugs: Default named parameters in the graph library can not be used with ... (closed: fixed)">#2072</a> </p> Ticket jeff.baumes@… Tue, 30 Nov 2010 17:19:32 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1021#comment:5 https://svn.boost.org/trac10/ticket/1021#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> This bug has been reintroduced as of <a class="changeset" href="https://svn.boost.org/trac10/changeset/64645" title="Implementing bundled properties for graph properties. The initial ...">[64645]</a>. The same example files from 4 years ago cause compile issues, I just needed to update to the new path of property_map.hpp. I believe these six definitions inside the reverse_graph class should be taken out and separated from the class so they are only used when needed: </p> <pre class="wiki">83 typedef typename graph_property_type&lt;base_type&gt;::type graph_property_type; 84 typedef typename graph_bundle_type&lt;base_type&gt;::type graph_bundled; 85 86 typedef typename vertex_property_type&lt;base_type&gt;::type vertex_property_type; 87 typedef typename vertex_bundle_type&lt;base_type&gt;::type vertex_bundled; 88 89 typedef typename edge_property_type&lt;base_type&gt;::type edge_property_type; 90 typedef typename edge_bundle_type&lt;base_type&gt;::type edge_bundled; </pre><p> The earlier fix fixed some of these, and indeed it looks like vertex_property_type and edge_property_type are now defined two ways, both inside and outside the class: </p> <pre class="wiki">120 // These are separate so they are not instantiated unless used (see bug 1021) 121 template &lt;class BidirectionalGraph, class GraphRef&gt; 122 struct vertex_property_type&lt;reverse_graph&lt;BidirectionalGraph, GraphRef&gt; &gt; { 123 typedef typename boost::vertex_property_type&lt;BidirectionalGraph&gt;::type type; 124 }; 125 126 template &lt;class BidirectionalGraph, class GraphRef&gt; 127 struct edge_property_type&lt;reverse_graph&lt;BidirectionalGraph, GraphRef&gt; &gt; { 128 typedef typename boost::edge_property_type&lt;BidirectionalGraph&gt;::type type; 129 }; </pre> Ticket Jeremiah Willcock Tue, 30 Nov 2010 18:16:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1021#comment:6 https://svn.boost.org/trac10/ticket/1021#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66907" title="Fixed up computation of property types; fixes #1021">[66907]</a>) Fixed up computation of property types; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1021" title="#1021: Bugs: [Graph][reverse_graph] Problem using reverse_graph adapter with an ... (closed: fixed)">#1021</a> </p> Ticket