From 8b024986da824da43049bbe3f30a0e17a2c0698f Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 10 Jul 2023 18:17:40 +0200 Subject: [PATCH] restricted force_evaluation workaround to VS --- .../detail/foa/takes_arg_as_const_reference.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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<