From d73f1d2a7605bb6e52190fe69f4cb94330392a02 Mon Sep 17 00:00:00 2001 From: CromwellEnage <32967088+CromwellEnage@users.noreply.github.com> Date: Wed, 19 Dec 2018 23:32:51 -0500 Subject: [PATCH] Fix regressions & update .yml scripts * Original fix worked only when one boost::parameter::keyword was bound and passed in. This fix now works when binding and passing in one or more boost::parameter::keyword objects. * Make isomorphism_impl a metafunction that returns the function object result_type for the fix to work. "test/isomorphism.cpp" * Test the fix with two boost::parameter::keyword objects. ".travis.yml" "appveyor.yml" * Update as per Peter Dimov's message announcing the merging of CMake into boostorg/develop. --- .travis.yml | 2 + appveyor.yml | 2 + include/boost/graph/isomorphism.hpp | 1 + include/boost/graph/named_function_params.hpp | 41 +++++++++---------- test/isomorphism.cpp | 3 +- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 15171926..e1cab861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -274,6 +274,8 @@ install: - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root + - git submodule update --init tools/boost_install + - git submodule update --init libs/headers - git submodule update --init tools/build - git submodule update --init libs/config - git submodule update --init tools/boostdep diff --git a/appveyor.yml b/appveyor.yml index 27205224..d249d808 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,6 +44,8 @@ install: - cd .. - git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root + - git submodule update --init tools/boost_install + - git submodule update --init libs/headers - git submodule update --init tools/build - git submodule update --init libs/config - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\graph diff --git a/include/boost/graph/isomorphism.hpp b/include/boost/graph/isomorphism.hpp index 225cd205..cf70834a 100644 --- a/include/boost/graph/isomorphism.hpp +++ b/include/boost/graph/isomorphism.hpp @@ -501,6 +501,7 @@ fi_adj_loop_k:++fi_adj.first; template struct isomorphism_impl { typedef bool result_type; + typedef result_type type; template bool operator()(const Graph1& g1, const Graph2& g2, const ArgPack& arg_pack) const { using namespace boost::graph::keywords; diff --git a/include/boost/graph/named_function_params.hpp b/include/boost/graph/named_function_params.hpp index 234a6428..ec8dfb7c 100644 --- a/include/boost/graph/named_function_params.hpp +++ b/include/boost/graph/named_function_params.hpp @@ -515,17 +515,26 @@ BOOST_BGL_DECLARE_NAMED_PARAMS BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONEX(z, nnamed, BOOST_PP_SEQ_ELEM(0, seq), BOOST_PP_SEQ_ELEM(1, seq)) #define BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONEX(z, nnamed, name, nfixed) \ - template \ - typename boost::result_of< \ - detail::BOOST_PP_CAT(name, _impl) \ - (BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) \ - const typename boost::detail::make_arg_pack_type::type&) \ - >::type \ - name(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param) \ - BOOST_PP_ENUM_TRAILING(nnamed, BOOST_GRAPH_MAKE_PAIR_PARAM, ~)) { \ - return detail::BOOST_PP_CAT(name, _impl)() \ - (BOOST_PP_ENUM_PARAMS(nfixed, param), \ - (boost::parameter::aux::empty_arg_list() BOOST_PP_ENUM_TRAILING_PARAMS(nnamed, kw))); \ + template < \ + BOOST_PP_ENUM_PARAMS_Z(z, nfixed, typename Param) \ + BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, nnamed, typename ArgumentPack) \ + > \ + typename \ + BOOST_PP_EXPR_IF(nnamed, boost::lazy_enable_if) \ + BOOST_PP_COMMA_IF(nnamed) \ + ::boost::graph::detail::BOOST_PP_CAT(name, _impl) \ + BOOST_PP_EXPR_IF(nnamed, >)::type \ + name( \ + BOOST_PP_ENUM_BINARY_PARAMS_Z(z, nfixed, Param, const& param) \ + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, nnamed, ArgumentPack, const& tagged_arg) \ + ) \ + { \ + return ::boost::graph::BOOST_PP_CAT(name, _with_named_params)( \ + BOOST_PP_ENUM_PARAMS_Z(z, nfixed, param) \ + BOOST_PP_COMMA_IF(nnamed) BOOST_PP_LPAREN_IF(nnamed) \ + BOOST_PP_ENUM_PARAMS_Z(z, nnamed, tagged_arg) \ + BOOST_PP_RPAREN_IF(nnamed) \ + ); \ } #define BOOST_GRAPH_MAKE_OLD_STYLE_PARAMETER_FUNCTION(name, nfixed) \ @@ -540,16 +549,6 @@ BOOST_BGL_DECLARE_NAMED_PARAMS BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(old_style_params_type, old_style_params) \ return ::boost::graph::BOOST_PP_CAT(name, _with_named_params)(BOOST_PP_ENUM_PARAMS(nfixed, param) BOOST_PP_COMMA_IF(nfixed) arg_pack); \ } \ - namespace graph { \ - template \ - typename boost::lazy_enable_if, boost::result_of< \ - ::boost::graph::detail::BOOST_PP_CAT(name, _impl) BOOST_PP_EXPR_IF(nfixed, <) BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_EXPR_IF(nfixed, >) \ - (BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) const ArgumentPack&) \ - > >::type \ - name(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param) BOOST_PP_COMMA_IF(nfixed) const ArgumentPack& tagged_arg) { \ - return ::boost::graph::BOOST_PP_CAT(name, _with_named_params)(BOOST_PP_ENUM_PARAMS(nfixed, param) BOOST_PP_COMMA_IF(nfixed) tagged_arg); \ - } \ - } \ BOOST_PP_EXPR_IF(nfixed, template <) BOOST_PP_ENUM_PARAMS(nfixed, typename Param) BOOST_PP_EXPR_IF(nfixed, >) \ BOOST_PP_EXPR_IF(nfixed, typename) boost::result_of< \ ::boost::graph::detail::BOOST_PP_CAT(name, _impl) BOOST_PP_EXPR_IF(nfixed, <) BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_EXPR_IF(nfixed, >) \ diff --git a/test/isomorphism.cpp b/test/isomorphism.cpp index bf7ddb5d..fe7ff4e9 100644 --- a/test/isomorphism.cpp +++ b/test/isomorphism.cpp @@ -133,7 +133,8 @@ void test_isomorphism2() bool isomorphism_correct; clock_t start = clock(); BOOST_CHECK(isomorphism_correct = boost::graph::isomorphism - (g1, g2, _isomorphism_map = make_assoc_property_map(mapping))); + (g1, g2, _vertex_index1_map = get(vertex_index, g1), + _isomorphism_map = make_assoc_property_map(mapping))); clock_t end = clock(); std::cout << "Elapsed time (clock cycles): " << (end - start) << std::endl;