Boost logo

Boost Users :

Subject: [Boost-users] Lambda: Accessing fields of 'var'ed variable
From: Swidan, Firas (firas.swidan_at_[hidden])
Date: 2008-12-29 03:31:00


Hi,

I am trying to deal with the following situation:

class tr
{
public:
            int i;
            int j;
};

vector<tr> v(10);
vector<uint> idx(5);
for_each(idx.begin(), idx.end(), var(v)[_1].i = 1);

This does not compile though, because lambda_functor has no member named i.

My understanding is that I need the var before the v (also removing the var results in a compilation error).

Am I on the right path?

Thanks,
Firas.

-------------
Dr Firas Swidan, PhD
Tel: +972.4.486.6278
E-mail: firas.swidan_at_[hidden]<mailto:firas.swidan_at_[hidden]>
Intel Israel (74) Ltd.
P.O.Box 1659, Haifa 31015, Israel

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



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