Boost logo

Boost Users :

From: yjwang_bj yjwang_bj_at_[hidden])
Date: 2003-02-18 12:05:21


> 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

It works but with the unusual C++ syntax. In libsigc++, I can do like
this:
sig1.connect(slot(x, &X::foo));

Hope boost has something like this though the boost's way is more
powerful.

Thanks a lot, doug.

Yujiang Wang


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