$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-02-17 09:08:09
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