Boost C++ Libraries: Ticket #10895: graph - copy_component is broken https://svn.boost.org/trac10/ticket/10895 <p> I noticed two issues with copy_component in graph/copy.hpp. </p> <ol><li>The non-named parameter version gives compiler error due to failing look up: </li></ol><pre class="wiki"> return detail::copy_component_impl (g_in, src, g_out, make_vertex_copier(g_in, g_out), make_edge_copier(g_in, g_out), make_iterator_property_map(orig2copy.begin(), get(vertex_index, g_in), orig2copy[0]), bgl_named_params&lt;char,char&gt;('x') // dummy param object ); </pre><p> error: 'make_vertex_copier' was not declared in this scope. </p> <p> Prefixing them with <strong>detail::</strong> solves this issue. This change makes it similar to copy_graph which also refers to the detail namespace for these functions. </p> <p> Fixed version: </p> <pre class="wiki"> return detail::copy_component_impl (g_in, src, g_out, detail::make_vertex_copier(g_in, g_out), detail::make_edge_copier(g_in, g_out), make_iterator_property_map(orig2copy.begin(), get(vertex_index, g_in), orig2copy[0]), bgl_named_params&lt;char,char&gt;('x') // dummy param object ); </pre><ol start="2"><li>In graph_copy_visitor struct's <strong>copy_one_vertex</strong> member function, the template arguments include <strong>class Graph</strong> but it is not used (neither in the function arguments nor inside the func. body). </li></ol><pre class="wiki"> template &lt;class Vertex, class Graph&gt; typename graph_traits&lt;NewGraph&gt;::vertex_descriptor copy_one_vertex(Vertex u) const { ... } </pre><p> So the compiler complains about the failing deduction. </p> <p> error: template argument deduction/substitution failed: note: couldn't deduce template parameter 'Graph' </p> <p> Fix: Removing the template argument class Graph fixes the issue. </p> <pre class="wiki"> template &lt;class Vertex&gt; typename graph_traits&lt;NewGraph&gt;::vertex_descriptor copy_one_vertex(Vertex u) const { ... } </pre><p> Note: Tried with GCC 4.7.2 and 4.8.3 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10895 Trac 1.4.3 ich.freak@… Thu, 23 Apr 2015 21:40:19 GMT <link>https://svn.boost.org/trac10/ticket/10895#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10895#comment:1</guid> <description> <p> I have the same problem, although I'm running 1.55.0, there were no changed to copy.hpp between 1.55.0 and 1.58.0 (which I understand is the latest version). </p> <p> thanks </p> </description> <category>Ticket</category> </item> <item> <author>ich.freak@…</author> <pubDate>Fri, 24 Apr 2015 08:07:39 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/10895 https://svn.boost.org/trac10/ticket/10895 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_copy_component.patch</span> </li> </ul> <p> patch for convenience </p> Ticket