1 #ifndef TERMOX_WIDGET_DETAIL_LINK_LIFETIMES_HPP
2 #define TERMOX_WIDGET_DETAIL_LINK_LIFETIMES_HPP
5 #include <signals_light/signal.hpp>
7 #include <termox/widget/detail/memfn_signature.hpp>
13 template <
typename... Widgets,
15 typename Signature = detail::Call_signature_t<F>>
16 [[nodiscard]]
auto link_lifetimes(F&& method, Widgets&... widgets)
17 -> sl::Slot<Signature>
19 static_assert(
sizeof...(widgets) > 0,
"You must link at least 1 lifetime");
20 auto slot = sl::Slot<Signature>{std::forward<F>(method)};
21 (slot.track(widgets.lifetime), ...);