Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Signals2 - if slot (functor of lambda) destructs the signal, calling the slot itself -> safe for functor?
From: nice sw123 (nicesw123_at_[hidden])
Date: 2015-09-04 17:58:37


Oh and an absolute basics question...

Does the connect function copy functors?
I believe it does, so the code below would be safe.
(Is that correct????)

Thanks

boost::signals2::signal<void()> sig;
{
   Slot_Functor slot;
   sig.connect(slot);
}
sig();

Is there any case, where a slot could go out of scope before the
signal is called??
If functors (and lambdas) are nicely copied, then I believe that the
slot will always be in scope when it is called.
(??)

Thanks


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net