15 Feb
2007
15 Feb
'07
12:58 p.m.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Allan Douglas Sent: Thursday, February 15, 2007 1:03 AM To: boost-users@lists.boost.org Subject: [Boost-users] [signals] Chaining slots For example: float square(float x) { return x*x; } float sum1(float x) { return x+1; } boost::signal<float (float x)> sig; /* do some magic here */ sig.connect(&square); sig.connect(&sum1); sig.connect(&square); // sig(2) should call square(sum1(square(2))) std::cout << sig(2) << std::endl; I want the example to output 25 ( (2**2)+1)**2) Any ideas on how to implement this? [Nat] Sounds to me like a custom Combiner. http://boost.org/doc/html/signals/s06.html#id2739686