RE: [Boost-Users] Re: How to connect arbitrary memeber function i n boost::signals?
#define myslot(obj, mem) boost::bind(mem, obj, _1)
-----Original Message----- From: yjwang_bj
[mailto:yjwang_bj@yahoo.com] Sent: Tuesday, February 18, 2003 9:05 AM To: Boost-Users@yahoogroups.com 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
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@yahoogroups.com
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. -----------------------------------------------------------------------
participants (1)
-
Tom Matelich