Boost logo

Boost Users :

From: Tom Matelich (tmatelich_at_[hidden])
Date: 2003-02-18 12:18:40


#define myslot(obj, mem) boost::bind(mem, obj, _1)

> -----Original Message-----
> From: yjwang_bj <yjwang_bj_at_[hidden]> [mailto:yjwang_bj_at_[hidden]]
> Sent: Tuesday, February 18, 2003 9:05 AM
> To: Boost-Users_at_[hidden]
> Subject: [Boost-Users] Re: How to connect arbitrary memeber
> function in
> boost::signals?
>
>
> > 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
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get 128 Bit SSL Encryption!
>
http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/EbFolB/TM
> --------------------------------------------------------------
> -------~->
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

-----------------------------------------------------------------------
DISCLAIMER: Information contained in this message and/or
attachment(s) may contain confidential information of Zetec, Inc.
If you have received this transmission in error, please notify
the sender by return email.
-----------------------------------------------------------------------


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