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 722ee00b..cdaf43c2 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 @@ -9,6 +9,8 @@ #ifndef BOOST_UNORDERED_DETAIL_FOA_TAKES_ARG_AS_CONST_REFERENCE_HPP #define BOOST_UNORDERED_DETAIL_FOA_TAKES_ARG_AS_CONST_REFERENCE_HPP +#include +#include #include #include @@ -142,11 +144,14 @@ template struct takes_arg_as_const_reference: has_const_reference_arg>{}; +#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 * the instantiation has not been evaluated before. Passing through this - * function solves the problem. + * function solves the problem. Left as a VS-specific workaround because + * old GCC versions seem to have problems with it. */ + template T force_evaluation(T); template @@ -157,6 +162,16 @@ struct takes_arg_as_const_reference< takes_arg_as_const_reference< decltype(force_evaluation(&F::template operator())),Arg >{}; +#else +template +struct takes_arg_as_const_reference< + F,Arg, + boost::void_t)> +>: +takes_arg_as_const_reference< + decltype(&F::template operator()),Arg +>{}; +#endif template struct takes_arg_as_const_reference<