@@ -2446,6 +2446,8 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
24462446 template <typename O, typename M> %(O* object, M method);
24472447 template <typename O, typename M> %(com_ptr<O>&& object, M method);
24482448 template <typename O, typename M> %(weak_ref<O>&& object, M method);
2449+ template <typename O, typename M> %(std::shared_ptr<O>&& object, M method);
2450+ template <typename O, typename M> %(std::weak_ptr<O>&& object, M method);
24492451 auto operator()(%) const;
24502452 };
24512453)" ;
@@ -2462,6 +2464,8 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
24622464 type_name,
24632465 type_name,
24642466 type_name,
2467+ type_name,
2468+ type_name,
24652469 bind<write_consume_params>(signature));
24662470 }
24672471
@@ -2523,6 +2527,14 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
25232527 %([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } })
25242528 {
25252529 }
2530+ template <%> template <typename O, typename M> %<%>::%(std::shared_ptr<O>&& object, M method) :
2531+ %([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
2532+ {
2533+ }
2534+ template <%> template <typename O, typename M> %<%>::%(std::weak_ptr<O>&& object, M method) :
2535+ %([o = std::move(object), method](auto&&... args) { if (auto s = o.lock()) { ((*s).*(method))(args...); } })
2536+ {
2537+ }
25262538 template <%> auto %<%>::operator()(%) const
25272539 {%
25282540 check_hresult((*(impl::abi_t<%<%>>**)this)->Invoke(%));%
@@ -2562,6 +2574,16 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
25622574 bind<write_generic_typenames>(generics),
25632575 type_name,
25642576 bind_list (" , " , generics),
2577+ type_name,
2578+ type_name,
2579+ bind<write_generic_typenames>(generics),
2580+ type_name,
2581+ bind_list (" , " , generics),
2582+ type_name,
2583+ type_name,
2584+ bind<write_generic_typenames>(generics),
2585+ type_name,
2586+ bind_list (" , " , generics),
25652587 bind<write_consume_params>(signature),
25662588 bind<write_consume_return_type>(signature, true ),
25672589 type_name,
@@ -2591,6 +2613,14 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
25912613 %([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } })
25922614 {
25932615 }
2616+ template <typename O, typename M> %::%(std::shared_ptr<O>&& object, M method) :
2617+ %([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
2618+ {
2619+ }
2620+ template <typename O, typename M> %::%(std::weak_ptr<O>&& object, M method) :
2621+ %([o = std::move(object), method](auto&&... args) { if (auto s = o.lock()) { ((*s).*(method))(args...); } })
2622+ {
2623+ }
25942624 inline auto %::operator()(%) const
25952625 {%
25962626 check_hresult((*(impl::abi_t<%>**)this)->Invoke(%));%
@@ -2615,6 +2645,12 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
26152645 type_name,
26162646 type_name,
26172647 type_name,
2648+ type_name,
2649+ type_name,
2650+ type_name,
2651+ type_name,
2652+ type_name,
2653+ type_name,
26182654 bind<write_consume_params>(signature),
26192655 bind<write_consume_return_type>(signature, true ),
26202656 type_name,
0 commit comments