Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ target_link_libraries(boost_graph
Boost::smart_ptr
Boost::spirit
Boost::throw_exception
Boost::tti
Boost::tuple
Boost::type_traits
Boost::unordered
Expand Down
1 change: 0 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ constant boost_dependencies :
/boost/smart_ptr//boost_smart_ptr
/boost/spirit//boost_spirit
/boost/throw_exception//boost_throw_exception
/boost/tti//boost_tti
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/unordered//boost_unordered
Expand Down
32 changes: 18 additions & 14 deletions include/boost/graph/depth_first_search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include <boost/optional.hpp>
#include <boost/parameter.hpp>
#include <boost/concept/assert.hpp>
#include <boost/tti/has_member_function.hpp>
#include <boost/type_traits/make_void.hpp>
#include <type_traits>

#include <vector>
#include <utility>
Expand Down Expand Up @@ -68,7 +69,19 @@ namespace detail
}
};

BOOST_TTI_HAS_MEMBER_FUNCTION(finish_edge)
// has_finish_edge<Vis, E, G>::value is true when vis.finish_edge(e, g) is
// a valid call for e of type E and g of type const G&.
template < typename Vis, typename E, typename G, typename = void >
struct has_finish_edge : std::false_type
{
};
template < typename Vis, typename E, typename G >
struct has_finish_edge< Vis, E, G,
boost::void_t< decltype(std::declval< Vis& >().finish_edge(
std::declval< E& >(), std::declval< const G& >())) > >
: std::true_type
{
};

template < bool IsCallable > struct do_call_finish_edge
{
Expand All @@ -89,18 +102,9 @@ namespace detail

template < typename E, typename G, typename Vis >
void call_finish_edge(Vis& vis, E e, const G& g)
{ // Only call if method exists
#if ((defined(__GNUC__) && (__GNUC__ > 4) \
|| ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))) \
|| defined(__clang__) \
|| (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)))
do_call_finish_edge< has_member_function_finish_edge< Vis, void,
boost::mpl::vector< E, const G& > >::value >::call_finish_edge(vis,
e, g);
#else
do_call_finish_edge< has_member_function_finish_edge< Vis,
void >::value >::call_finish_edge(vis, e, g);
#endif
{ // Only call if the visitor has a callable finish_edge(e, g)
do_call_finish_edge< has_finish_edge< Vis, E, G >::value >::
call_finish_edge(vis, e, g);
}

// Define BOOST_RECURSIVE_DFS to use older, recursive version.
Expand Down
Loading