static void connect_method(Subject& subject, Foo& foo) { subject.Connect(&foo, &Foo::handler); // Automatically disconnect when the foo instance is destroyed // Benchmarks require connection management foo.reg = make_slot_scope([&](void*) { subject.Disconnect(&foo, &Foo::handler); }); }
static void connect_method(Subject& subject, Foo& foo) { subject.Connect(&foo, &Foo::handler); }