On 3/31/2014 6:30 PM, Edward Diener wrote:
On 3/31/2014 1:27 PM, Michael Behrns-Miller wrote:
... Here's how BGL defines it:
-------------
BOOST_TTI_HAS_MEMBER_FUNCTION(finish_edge)
template <bool IsCallable> struct do_call_finish_edge { template
static void call_finish_edge(Vis& vis, const E& e, const G& g) { vis.finish_edge(e, g); } }; template <> struct do_call_finish_edge<false> { template
static void call_finish_edge(Vis&, const E&, const G&) {} }; template
void call_finish_edge(Vis& vis, const E& e, const G& g) { // Only call if method exists do_call_finish_edge ::value>::call_finish_edge(vis, e, g); } The invocation of has_member_function_finish_edge has to match the member function signature which you are invoking. If the member function signature for finish_edge is:
void finish_edge(const E&, const G&);
then your invocation for do_call_finish_edge must be:
do_call_finish_edge < has_member_function_finish_edge < Vis, void, boost::mpl::vector < const E&, const G& > > ::value
::call_finish_edge(vis, e, g);
or
do_call_finish_edge < has_member_function_finish_edge < void Vis::* (const E&,const G&) > ::value
::call_finish_edge(vis, e, g);
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thank you Edward.
The instantiation code was not mine, that is what is done by the BGL, here:
boost\graph\depth_first_search.hpp
The instantiation code does not seem to match your recommendation. This
simple DFS test fails:
https://svn.boost.org/trac/boost/attachment/ticket/9770/test.cc
So it sounds like BGL needs some patching to match your format. It
should change from...
do_call_finish_edge