// copied from https://github.com/fmtlib/fmt/pull/1028/commits/e59cf9f7134454d7502a73858f5f9c2aac48b72e
// "Replace 'result_of' by 'std::invoke_result' where possible (#1025) #1028"
template <typename> struct result_of;
#if (__cplusplus >= 201703L || \
(defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && \
__cpp_lib_is_invocable >= 201703L
template <typename F, typename... Args>
struct ::result_of<F(Args...)> : std::invoke_result<F, Args...> {};
#else
// A workaround for gcc 4.4 that doesn't allow F to be a reference.
template <typename F, typename... Args>
struct result_of<F(Args...)> : result_of<typename std::remove_reference<F>::type(Args...)> {
};
#endif
// copied from <type_traits> in MSVC
#pragma warning(push)
#pragma warning(disable : 4996) // was declared deprecated
template <class _Ty>
using result_of_t = typename ::result_of<_Ty>::type;
#pragma warning(pop)
Comments
0 B
|👍
/👎
0 B
|👍
/👎