
22 Oct
2013
22 Oct
'13
8:01 p.m.
On Tue, Oct 22, 2013 at 12:56 PM, ustulation
oh i see. I did the same thing myself instead of using track_foreign. In my case the signal is a private member of a class so it's not directly accessible at the site which wants to register a callback. Instead the class with the signal has function exposed so i wonder if using track would be possible. I did something like this:
boost::signals2::connection ClassWithSignal::registerListener(const std::function< void() > &refListener) { return m_signal.connect(refListener); }
You could pass the slot as a slot instead of a std::function: http://www.boost.org/doc/libs/1_54_0/libs/signals2/example/passing_slots.cpp or use templates to do perfect forwarding.