Fix std::result_of deprecation error in C++17 (fixes issue #3194)

This commit is contained in:
Hunter Laux
2022-02-24 17:34:10 +00:00
committed by Marshall Greenblatt
parent d24ea7572f
commit 477ab61e3b

View File

@ -276,8 +276,13 @@ struct negation : bool_constant<!static_cast<bool>(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 <typename Functor, typename... Args>
using invoke_result = std::invoke_result<Functor, Args...>;
#else
template <typename Functor, typename... Args>
using invoke_result = std::result_of<Functor && (Args && ...)>;
#endif
// Implementation of C++17's std::invoke_result_t.
//