diff --git a/include/boost/graph/named_function_params.hpp b/include/boost/graph/named_function_params.hpp index ea4690b6..0d65a032 100644 --- a/include/boost/graph/named_function_params.hpp +++ b/include/boost/graph/named_function_params.hpp @@ -272,40 +272,45 @@ BOOST_BGL_DECLARE_NAMED_PARAMS property_map >, boost::mpl::identity > {}; - // Parameters are (NotFound, GraphIsConst, Graph, Param, Tag) - template - typename property_map::const_type - choose_impl(boost::mpl::true_, boost::mpl::true_, const Graph& g, const Param&, PropertyTag tag) { - return get(tag, g); - } + // Parameters of f are (GraphIsConst, Graph, Param, Tag) + template struct choose_impl_helper; - template - typename property_map::type - choose_impl(boost::mpl::true_, boost::mpl::false_, Graph& g, const Param&, PropertyTag tag) { - return get(tag, g); - } + template <> struct choose_impl_helper { + template + static typename property_map::const_type + f(boost::mpl::true_, const Graph& g, const Param&, PropertyTag tag) { + return get(tag, g); + } - template - Param - choose_impl(boost::mpl::false_, GraphIsConst, const Graph&, const Param& p, PropertyTag) { - return p; - } + template + static typename property_map::type + f(boost::mpl::false_, Graph& g, const Param&, PropertyTag tag) { + return get(tag, g); + } + }; + + template <> struct choose_impl_helper { + template + static Param f(GraphIsConst, const Graph&, const Param& p, PropertyTag) { + return p; + } + }; } template typename detail::choose_impl_result::type choose_const_pmap(const Param& p, const Graph& g, PropertyTag tag) { - return detail::choose_impl(boost::mpl::bool_::value>(), - boost::mpl::true_(), g, p, tag); + return detail::choose_impl_helper::value> + ::f(boost::mpl::true_(), g, p, tag); } template typename detail::choose_impl_result::type choose_pmap(const Param& p, Graph& g, PropertyTag tag) { - return detail::choose_impl(boost::mpl::bool_::value>(), - boost::mpl::false_(), g, p, tag); + return detail::choose_impl_helper::value> + ::f(boost::mpl::false_(), g, p, tag); } namespace detail {