template<class Fun, class... Args>
    constexpr auto wrap_call(Fun&& f, Args&&... args)
        noexcept(std::forward<Fun>(f)(std::forward<Args>(args)...))->decltype(std::forward<Fun>(f)(std::forward<Args>(args)...))
    {
        return std::forward<Fun>(f)(std::forward<Args>(args)...);
    }
    template<typename R, typename Fun, typename... Args>
    constexpr auto wrap_call_ex(Fun&& f, Args&&... args)
    {
        return std::invoke(reinterpret_cast<R(__stdcall*)(Args ...)>(typename::std::forward<Fun>(f)), typename::std::forward<Args>(args)...);
    }

标签: none

评论已关闭