From 318f46bf46ffb3439ccdab36b49f63ef9c0cb186 Mon Sep 17 00:00:00 2001 From: Hunter Laux Date: Thu, 24 Feb 2022 17:34:10 +0000 Subject: [PATCH] Fix std::result_of deprecation error in C++17 (fixes issue #3194) --- include/base/cef_template_util.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/base/cef_template_util.h b/include/base/cef_template_util.h index 78a0ebcc0..9d16f0a3f 100644 --- a/include/base/cef_template_util.h +++ b/include/base/cef_template_util.h @@ -276,8 +276,13 @@ struct negation : bool_constant(B::value)> {}; // References: // [1] https://en.cppreference.com/w/cpp/types/result_of // [2] https://wg21.link/meta.trans.other#lib:invoke_result +#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) +template +using invoke_result = std::invoke_result; +#else template using invoke_result = std::result_of; +#endif // Implementation of C++17's std::invoke_result_t. //