Boost logo

Boost Users :

From: Mathieu De Zutter (mathieu_at_[hidden])
Date: 2005-04-20 10:33:14


Hi,

I have some code that runs fine:

for (Partition::iterator pi = renderRegions.begin(); pi !=
        renderRegions.end(); ++pi);
    (*pi)->render(&ltt, foo, si);

I try to replace it by for_each & boost::bind,

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.

Some more relevant code:

class Region
{
    ...
    void render(const LightTransportType* ltt, WorkAppraiser& wa,
        image::SampleImage& result);
    ...
};

typedef std::vector< Region* > Partition;
Partition renderRegions;

Is this normal behaviour?

-- 
With kind regards,
Mathieu

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