|
Boost : |
Subject: Re: [boost] [scope_exit] can MSVC lambdas capture data members?
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-03-14 18:32:00
on Wed Mar 14 2012, Nathan Ridge <zeratul976-AT-hotmail.com> wrote:
> GCC 4.5 is in error to allow that. 4.7 does not allow it.
>
> The correct way to use a data member in the lambda is to capture "this", and then
> access the member via "this->member" inside the lambda.
Actually you get implicit access to all the members once you capture
"this." That said, I don't think anyone should use that capability :-)
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk