Hi, I am still digesting the information. I understand the problem with lifetime management but when I do: sig.connect(x); and x being the listener, I would expect x to be called, not another instance of X. I will study more what you guys have explained. I hope at some point it will click on my mind. :)
As for your initial problem of the receiver being dis-associated from the callable, it's probably because it's not properly copyable I thought the compiler would generate a copy constructor and assignment operator suitable for S. Is not the case ?
struct S
{
int x;
S (): x(0) {}
void operator () (int i)
{
std::cout << "&slot1 = " << this << std::endl;
x = i;
std::cout << "slot1.x = " << this->x << std::endl;
}
};
Thank you !
2010/8/20 Lars Viklund
AMDG
As for your initial problem of the receiver being dis-associated from the callable, it's probably because it's not properly copyable.
It's normally good form to make things that should not be copied boost::noncopyable or otherwise artificially restricted from copying, in order to catch such assumptions at an early stage instead of through runtime bugs.
-- Lars Viklund | zao@acc.umu.se _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Mau