
"Peter Dimov"
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 ) )
Peter, you are better! I think that should be simple solution. Thank you! Now I want to write something more difficult: apReports.push_back(make_report(boost::lambda::bind(&CItem::GetItemCount)*boost::lambda::bind((&CItem::GetItemBytes))); or apReports.push_back(make_report(boost::lambda::bind(&CItem::GetItemCount)*100.0/boost::lambda::bind((&CItem::GetTotalCount))); Is there any way to make it with boost library? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ----------