Subject: [Boost-bugs] [Boost C++ Libraries] #10895: graph - copy_component is broken
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-23 21:13:48
#10895: graph - copy_component is broken
----------------------------------+----------------------
Reporter: erdem@⦠| Owner: jewillco
Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
Version: Boost 1.57.0 | Severity: Problem
Keywords: graph copy_component |
----------------------------------+----------------------
I noticed two issues with copy_component in graph/copy.hpp.
1. The non-named parameter version gives compiler error due to failing
look up:
{{{
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<char,char>('x') // dummy param object
);
}}}
error: 'make_vertex_copier' was not declared in this scope.
Prefixing them with '''detail::''' solves this issue. This change makes it
similar to copy_graph which also refers to the detail namespace for these
functions.
Fixed version:
{{{
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<char,char>('x') // dummy param object
);
}}}
2. In graph_copy_visitor struct's '''copy_one_vertex''' member function,
the template arguments include '''class Graph''' but it is not used
(neither in the function arguments nor inside the func. body).
{{{
template <class Vertex, class Graph>
typename graph_traits<NewGraph>::vertex_descriptor
copy_one_vertex(Vertex u) const { ... }
}}}
So the compiler complains about the failing deduction.
error: template argument deduction/substitution failed: note: couldn't
deduce template parameter 'Graph'
Fix: Removing the template argument class Graph fixes the issue.
{{{
template <class Vertex>
typename graph_traits<NewGraph>::vertex_descriptor
copy_one_vertex(Vertex u) const { ... }
}}}
Note: Tried with GCC 4.7.2 and 4.8.3
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10895> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC