Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-02-15 10:21:55


Сергей Островский wrote:
> I have a problem. Here is example of my code:

> Now I want to output to a stream some fields of CAddress class. I can
> get a reference to CAddress object with the CItem::GetAddress method.
> So I am writing something like it:
>
> apReports.push_back(make_report(boost::bind(&CAddress::GetName,boost::mem_fun(&CItem::GetAddress)));
> apReports.push_back(make_report(boost::bind(&CAddress::GetSize,boost::mem_fun(&CItem::GetAddress)));
>
> these 2 lines are not compiled.

Use

    boost::bind( &CAddress::GetName, boost::bind( &CItem::GetAddress, _1 ) )


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