[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