From 35c265f313624066493c3b4df665c7bc43246cd3 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 10 Jul 2023 12:07:42 +0200 Subject: [PATCH] worked around C3517 error in VS2017 and older --- .../detail/foa/takes_arg_as_const_reference.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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