Fix usage of result_of under C++20
This commit is contained in:
parent
67cc66080d
commit
4d87e19b01
|
@ -970,7 +970,7 @@ struct InvokeMethodWithoutArgsAction {
|
|||
Class* const obj_ptr;
|
||||
const MethodPtr method_ptr;
|
||||
|
||||
using ReturnType = typename std::result_of<MethodPtr(Class*)>::type;
|
||||
using ReturnType = typename InvokeResult<MethodPtr, Class*>::type;
|
||||
|
||||
template <typename... Args>
|
||||
ReturnType operator()(const Args&...) const {
|
||||
|
|
|
@ -460,6 +460,16 @@ struct Function<R(Args...)> {
|
|||
template <typename R, typename... Args>
|
||||
constexpr size_t Function<R(Args...)>::ArgumentCount;
|
||||
|
||||
// C++11 and 14 compatible invoke_result
|
||||
template<typename C, typename... Args>
|
||||
struct InvokeResult {
|
||||
#ifdef __cpp_lib_is_invocable
|
||||
typedef typename std::invoke_result<C, Args...>::type type;
|
||||
#else
|
||||
typedef typename std::result_of<C(Args...)>::type type;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user