infamouscheats icon

sfinktah — conditional result_of/invoke_result

infamouscheats | PRO | 04/07/19 02:54:27 PM UTC | 0 ⭐ | 13067 👁️ | Never ⏰ | []
C++ (WinAPI) |

0 B

|

None

|

0 👍

/

0 👎

// 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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎