20 Apr
2005
20 Apr
'05
9:21 p.m.
"Mathieu De Zutter"
Hi,
I have some code that runs fine:
for (Partition::iterator pi = renderRegions.begin(); pi != renderRegions.end(); ++pi); (*pi)->render(<t, foo, si);
I try to replace it by for_each & boost::bind,
std::for_each(renderRegions.begin(), renderRegions.end(), boost::bind(&Region::render, _1, <t, foo, si));
but si doesn't get modified, while it should be passed as reference.
Try using: std::for_each(renderRegions.begin(), renderRegions.end(), boost::bind(&Region::render, _1, <t, foo, boost::ref(si)));
-- With kind regards, Mathieu
Pablo Aguilar