Re: [Boost-users] boost::bond and assignment

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? Cheers ___________________________________________________________ This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is prohibited. Please refer to http://www.bnpparibas.co.uk/en/information/legal_information.asp?Code=ECAS-8... for additional disclosures.

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.
participants (2)
-
Peter Dimov
-
przemyslaw.sliwa@uk.bnpparibas.com