20 Sep
2010
20 Sep
'10
8:11 a.m.
przemyslaw.sliwa wrote:
Thank,
This is true if you have a boost::shared_ptr<int> but in my case I have a class not an int and I want to assign a value of one of its members called mem,
for(vector<clss>::iterator pos=tmp.begin(); pos!=tmp.end(); ++tmp) { clss& item = (*pos); item.mem = 1.0; }
how this can be translated into the boost lambda or bind?
The two ways to write this with lambda are (&*_1)->*&clss::mem = 1.0 and bind( &clss::mem, *_1 ) = 1.0 I haven't tried either of them though.