Boost logo

Boost Users :

Subject: [Boost-users] [signals] References rather than copies of functors in slots
From: James C. Sutherland (James.Sutherland_at_[hidden])
Date: 2009-05-14 13:16:34


It appears that when a slot is attached to a signal it is copied in.
However, if the slot contains a functor, and I want to modify the
contents of the functor object, then those changes are not made in the
slot since it is a copy of the original object.

This is probably a really simple question, but how do tell a signal to
hold references/pointers to slot objects rather than copies? Is there
a trick with boost::shared_ptr or something?

Thanks for any tips.

James


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