
15 Feb
2007
15 Feb
'07
11:57 p.m.
Sergey Ostrovskiy wrote:
Now I want to write something more difficult:
apReports.push_back(make_report(boost::lambda::bind(&CItem::GetItemCount)*boost::lambda::bind((&CItem::GetItemBytes)));
boost::lambda::bind(&CItem::GetItemCount, _1) * boost::lambda::bind((&CItem::GetItemBytes, _1)
or
apReports.push_back(make_report(boost::lambda::bind(&CItem::GetItemCount)*100.0/boost::lambda::bind((&CItem::GetTotalCount)));
boost::lambda::bind(&CItem::GetItemCount, _1)*100.0/boost::lambda::bind((&CItem::GetTotalCount, _1) but, depending on your argument type, it may need further fixes, such as using *_1 instead. lambda::bind doesn't handle smart pointers as 'this' well.