[BE] Get rid of std::result_of in c10 (#85977)

As it is a deprecated and to be removed in C++20

Fixes https://github.com/pytorch/pytorch/issues/85962

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85977
Approved by: https://github.com/kit1980
This commit is contained in:
Nikita Shulga
2022-09-30 23:13:42 +00:00
committed by PyTorch MergeBot
parent c2d9ea7f4b
commit 01292cc9e4

View File

@ -55,7 +55,7 @@ class function_ref<Ret(Params...)> {
typename std::remove_reference<Callable>::type,
function_ref>::value>::type* = nullptr,
typename std::enable_if<std::is_convertible<
typename std::result_of<Callable && (Params && ...)>::type,
typename c10::invoke_result_t<Callable, Params...>,
Ret>::value>::type* = nullptr)
: callback(callback_fn<typename std::remove_reference<Callable>::type>),
callable(reinterpret_cast<intptr_t>(&callable)) {}