Boost C++ Libraries: Ticket #9730: copy_graph doesn't use graph_traits https://svn.boost.org/trac10/ticket/9730 <p> copy_graph doesn't use graph_traits internally. Therefore, classes which don't have traversal_category and directed_category, such as std::vector or SGB, are not used as the source graph. </p> <p> follow code is compile error: </p> <pre class="wiki">#include &lt;vector&gt; #include &lt;list&gt; #include &lt;boost/graph/adjacency_list.hpp&gt; #include &lt;boost/graph/vector_as_graph.hpp&gt; #include &lt;boost/graph/copy.hpp&gt; int main() { using VectorGraph = std::vector&lt;std::list&lt;int&gt;&gt;; auto vgraph = VectorGraph{{1, 2, 3}, {3, 5}, {5}, {4}, {0, 2}, {0}}; using Graph = boost::adjacency_list&lt;&gt;; auto graph = Graph{}; boost::copy_graph(vgraph, graph , boost::vertex_copy([]( boost::graph_traits&lt;VectorGraph&gt;::vertex_descriptor , boost::graph_traits&lt;Graph&gt;::vertex_descriptor) {}) . edge_copy([]( boost::graph_traits&lt;VectorGraph&gt;::edge_descriptor , boost::graph_traits&lt;Graph&gt;::edge_descriptor) {}) ); } </pre><p> patch is here </p> <pre class="wiki">--- /usr/local/include/boost/graph/copy.hpp 2014-03-02 21:44:55.000000000 +0900 +++ copy.hpp 2014-03-02 21:45:05.000000000 +0900 @@ -248,8 +248,8 @@ template &lt;class Graph&gt; struct choose_graph_copy { - typedef typename Graph::traversal_category Trv; - typedef typename Graph::directed_category Dr; + typedef typename graph_traits&lt;Graph&gt;::traversal_category Trv; + typedef typename graph_traits&lt;Graph&gt;::directed_category Dr; enum { algo = (is_convertible&lt;Trv, vertex_list_graph_tag&gt;::value &amp;&amp; is_convertible&lt;Trv, edge_list_graph_tag&gt;::value) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9730 Trac 1.4.3