std::result_of creates problems when building with C++20 because it's deprecated there.
The solution is to remove it and get return value type for a function with decltype.
Substitute std::invoke_result for std::result_of is unnecessary because we don't have std::invoke semantics within the function - we don't work with pointer-to-member's.