From 35a20b4134d98e63e22a4879330c03f2f6577ece Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Tue, 4 Jan 2022 18:08:01 -0500 Subject: SERVER-62324 Fix unique_function issues in C++20 mode with VS 2022 --- src/mongo/stdx/type_traits.h | 33 --------------------------------- src/mongo/util/functional.h | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/mongo/stdx/type_traits.h b/src/mongo/stdx/type_traits.h index 62438228bba..f7187877b2a 100644 --- a/src/mongo/stdx/type_traits.h +++ b/src/mongo/stdx/type_traits.h @@ -92,39 +92,6 @@ struct conjunction : B {}; template struct conjunction : std::conditional_t, B1> {}; -namespace detail { -template ::type> -auto is_invocable_impl(Func&& func, Args&&... args) -> std::true_type; -auto is_invocable_impl(...) -> std::false_type; -} // namespace detail - -template -struct is_invocable - : decltype(detail::is_invocable_impl(std::declval(), std::declval()...)) {}; - -namespace detail { - -// This helps solve the lack of regular void problem, when passing a 'conversion target' as a -// parameter. - -template ::type> -auto is_invocable_r_impl(stdx::type_identity, Func&& func, Args&&... args) -> - typename stdx::disjunction, - std::is_same, - std::is_convertible>::type; -auto is_invocable_r_impl(...) -> std::false_type; -} // namespace detail - -template -struct is_invocable_r - : decltype(detail::is_invocable_r_impl( - stdx::type_identity(), std::declval(), std::declval()...)) {}; - } // namespace stdx } // namespace mongo diff --git a/src/mongo/util/functional.h b/src/mongo/util/functional.h index c30089a64e9..ca968ea9ca6 100644 --- a/src/mongo/util/functional.h +++ b/src/mongo/util/functional.h @@ -95,7 +95,7 @@ public: // requirements are met. They must be concrete parameters not template parameters to work // around bugs in some compilers that we presently use. We may be able to revisit this // design after toolchain upgrades for C++17. - std::enable_if_t::value, TagType> = + std::enable_if_t::value, TagType> = makeTag(), std::enable_if_t::value, TagType> = makeTag(), std::enable_if_t, unique_function>::value, TagType> = -- cgit v1.2.1