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 f8f446da..8db21c92 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 @@ -142,13 +142,20 @@ template struct takes_arg_as_const_reference: has_const_reference_arg>{}; +/* VS2017 and older issue a C3517 error when trying to obtain the type of + * an instantiation of a template function with deduced return type if + * the instantiation has not been evaluated before. Passing through this + * function solves the issue + */ +template constexpr T force_evaluation(T); + template struct takes_arg_as_const_reference< F,Arg, - boost::void_t)> + boost::void_t))> >: takes_arg_as_const_reference< - decltype(&F::template operator()),Arg + decltype(force_evaluation(&F::template operator())),Arg >{}; template