19 Aug
2010
19 Aug
'10
10:20 p.m.
AMDG Mauricio Gomes wrote:
I am running the program below (Vista with boost 1.43, mingw/gcc 4.5.1).
I would expect slot.x to be 5 but it is zero.
Why boost::signal creates another instance of the slot object ? What am I missing here ?
boost::signal stores a copy of the function object. If you don't want to make a copy use boost::ref. sig.connect(boost::ref(f)); If you do this, you need to be careful that the function object doesn't go out of scope too soon. In Christ, Steven Watanabe