MESSAGE
DATE | 2016-12-21 |
FROM | Ruben Safir
|
SUBJECT | Subject: [Learn] (fwd) Re: lamda's in classes
|
From learn-bounces-at-nylxs.com Wed Dec 21 17:18:50 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 323A2161312; Wed, 21 Dec 2016 17:18:50 -0500 (EST) X-Original-To: learn-at-nylxs.com Delivered-To: learn-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mrbrklyn.com (Postfix) with ESMTP id 7B624160E77 for ; Wed, 21 Dec 2016 17:18:44 -0500 (EST) Received: from panix3.panix.com (panix3.panix.com [166.84.1.3]) by mailbackend.panix.com (Postfix) with ESMTP id 11BBE13DD8 for ; Wed, 21 Dec 2016 17:18:42 -0500 (EST) Received: by panix3.panix.com (Postfix, from userid 20529) id CF7532EB51; Wed, 21 Dec 2016 17:18:42 -0500 (EST) From: Ruben Safir To: learn-at-nylxs.com User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (NetBSD/6.1.5 (i386)) Message-Id: <20161221221842.CF7532EB51-at-panix3.panix.com> Date: Wed, 21 Dec 2016 17:18:42 -0500 (EST) Subject: [Learn] (fwd) Re: lamda's in classes X-BeenThere: learn-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
-- forwarded message -- Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Alf P. Steinbach" Newsgroups: comp.lang.c++ Subject: Re: lamda's in classes Date: Wed, 21 Dec 2016 13:27:56 +0100 Organization: A noiseless patient Spider Lines: 13 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 21 Dec 2016 12:26:37 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="fe8fca16b78ae252151db53560870ba6"; logging-data="23639"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX18gm6JlgHKAnlaKfzqEYRxf" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 In-Reply-To: Cancel-Lock: sha1:3zns5GfXlxQhpAQ0QWf7VwaLwv8= Xref: panix comp.lang.c++:1126179
On 21.12.2016 10:09, ruben safir wrote: > 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? >
To use non-static data members in a lambda in a class' code, you have to capture `this`.
Cheers & hth.,
- Alf
-- end of forwarded message -- _______________________________________________ Learn mailing list Learn-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/learn
|
|