From 626a6243e3882498f5af4cd53a7aa92c3346864a Mon Sep 17 00:00:00 2001 From: Oblivion Date: Wed, 15 Dec 2021 21:18:05 +0000 Subject: [PATCH] C++20 not Building with VS2019 --- .../opentelemetry/nostd/absl/meta/type_traits.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/nostd/absl/meta/type_traits.h b/api/include/opentelemetry/nostd/absl/meta/type_traits.h index fc69bb5d66..74ae82a6b6 100644 --- a/api/include/opentelemetry/nostd/absl/meta/type_traits.h +++ b/api/include/opentelemetry/nostd/absl/meta/type_traits.h @@ -616,8 +616,21 @@ using common_type_t = typename std::common_type::type; template using underlying_type_t = typename std::underlying_type::type; -template -using result_of_t = typename std::result_of::type; +namespace type_traits_internal { + +#if __cplusplus >= 201703L +// std::result_of is deprecated (C++17) or removed (C++20) +template struct result_of; +template +struct result_of : std::invoke_result {}; +#else +template using result_of = std::result_of; +#endif + +} // namespace type_traits_internal + +template +using result_of_t = typename type_traits_internal::result_of::type; namespace type_traits_internal { // In MSVC we can't probe std::hash or stdext::hash because it triggers a