
17 Feb
2003
17 Feb
'03
7:08 a.m.
On Saturday 15 February 2003 09:48 am, "yjwang_bj wrote:
Hi, all.
I'm working in a project that need loosely coupling. I find boost::signals is perfect for that, save one exception.
My question is that I want to connect arbitrary member function to signal. How to do it?
Use the Bind or Lambda library. An example: class X { public: void foo(int); }; X* x; boost::signal<void (int)> sig; // So the signal will call x->foo(y) when sig(y) is called: sig.connect(boost::bind(&X::foo, x, _1)); Doug