diff --git a/include/boost/unordered/detail/foa/takes_arg_as_const_reference.hpp b/include/boost/unordered/detail/foa/takes_arg_as_const_reference.hpp index cdaf43c2..00b8ab65 100644 --- a/include/boost/unordered/detail/foa/takes_arg_as_const_reference.hpp +++ b/include/boost/unordered/detail/foa/takes_arg_as_const_reference.hpp @@ -138,12 +138,27 @@ BOOST_UNORDERED_HAS_CONST_REFERENCE_ARG_MEMFUN(const volatile&&) /* Detects if f(x) takes x as a const reference. From an implementation * technique by Kenneth Gorking. * Requires: F is invocable with an Arg&. + * takes_arg_as_const_reference implemented with an auxiliary + * takes_arg_as_const_reference0 base because VS2015 erroneously matches + * &F::operator() for templated call operators. */ template -struct takes_arg_as_const_reference: +struct takes_arg_as_const_reference0: has_const_reference_arg>{}; +template +struct takes_arg_as_const_reference0< + F,Arg, + boost::void_t +>: +takes_arg_as_const_reference0< + decltype(&F::operator()),Arg +>{}; + +template +struct takes_arg_as_const_reference:takes_arg_as_const_reference0{}; + #if BOOST_WORKAROUND(BOOST_MSVC,<1920) /* VS2017 and older issue a C3517 error when trying to obtain the type of * an instantiation of a function template with deduced return type if @@ -173,16 +188,6 @@ takes_arg_as_const_reference< >{}; #endif -template -struct takes_arg_as_const_reference< - F,Arg, - boost::void_t ->: -takes_arg_as_const_reference< - decltype(&F::operator()),Arg ->{}; - - } /* namespace foa */ } /* namespace detail */ } /* namespace unordered */