Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost to eliminate an ugly facade function
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-08-29 14:58:20


AMDG

On 08/29/2012 11:24 AM, Chris Stankevitz wrote:
> Hello,
>
> Can boost help me eliminate the ugly facade function I use below? I
> have a boost::signals2::signal that passes an object ("CPerson").
>
> I want to connect to this signal not to receive the object ("CPerson")
> but to receive the result of one of its methods ("CPerson::GetAge()").
> Can boost help me with this? If so I'm eager to read and learn about
> it, I just need to know what it is called.
>

You should be able to use a nested bind:
boost::bind(&CProcessor::f, &Processor,
  boost::bind(&CPerson::GetAge, _1))

In Christ,
Steven Watanabe


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