Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lamda's in classes

21 views
Skip to first unread message

ruben safir

unread,
Dec 21, 2016, 4:10:01 AM12/21/16
to
if you make a lamda with a method from a class, can that method see the
valuable values encapsulated with the object of that class, or can it
only see global variables?

Alf P. Steinbach

unread,
Dec 21, 2016, 7:28:13 AM12/21/16
to
To use non-static data members in a lambda in a class' code, you have to
capture `this`.

Cheers & hth.,

- Alf

jon...@boost.org

unread,
Dec 21, 2016, 6:46:09 PM12/21/16
to
Alf,

I want to congratulation you on understanding the question. Seeing your answer, I think you figured out the question and answered it correctly.

When I read the question, I had no idea what was being asked. I think the "valuable values" threw me most.

Jon
0 new messages