New paste Repaste Download
template<class TSender, typename TSender_abi, class TArgs>
struct FFRtTypedEventHandler : FFComObject<ABI::Windows::Foundation::ITypedEventHandler<TSender, TArgs>, IAgileObject>
{
    template <typename F>
    explicit FFRtTypedEventHandler(F&& f) : cb_func(std::forward<F>(f)) {}
    HRESULT STDMETHODCALLTYPE Invoke(TSender_abi sender, TArgs args) override
    {
        if (!cb_func)
            return S_OK;
        return cb_func(sender, args);
    }
private:
    std::function<HRESULT(TSender_abi, TArgs)> cb_func;
};
Filename: None. Size: 540b. View raw, , hex, or download this file.

This paste expires on 2025-10-02 20:33:46.020138. Pasted through web.