lambda functions

Hi,

I've been trying to pick up lambda functions but I wasnt clear on one detail- is there a rule of thumb when to use closure or a function parameter, when both can have the same effect?
In general it is preferable to have local variables instead of class data members where it is possible.
So, by default I should pass variables via function arguments, not closure?

Then, in what circumstances should specific closure be used?
When 1) you can not pass a variable as an argument 2) you need a reference to a variable.
Thanks for the tips.
> So, by default I should pass variables via function arguments, not closure?
> Then, in what circumstances should specific closure be used?

See: http://www.cplusplus.com/forum/general/63061/#msg342081
Topic archived. No new replies allowed.