Boost logo

Boost Users :

From: Kevin Heifner (heifner_k_at_[hidden])
Date: 2005-04-20 16:47:03


Mathieu De Zutter wrote:
> std::for_each(renderRegions.begin(), renderRegions.end(),
> boost::bind(&Region::render, _1, &ltt, foo, si));
>
> but si doesn't get modified, while it should be passed as reference.

You need to wrap foo and si in a ref().

std::for_each(renderRegions.begin(), renderRegions.end(),
     boost::bind(&Region::render, _1, &ltt, boost::ref(foo),
boost::ref(si)));

KevinH

-- 
Kevin Heifner  heifner @ ociweb.com  http://heifner.blogspot.com
           Object Computing, Inc. (OCI) www.ociweb.com

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