Boost logo

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 <> 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

Boost list run by bdawes at, gregod at, cpdaniel at, john at