Boost logo

Boost :

Subject: Re: [boost] [scope_exit] can MSVC lambdas capture data members?
From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2012-03-15 22:42:57


lcaminiti wrote:
> 1) I'd propose to never implement BOOST_SCOPE_EXIT using lambdas. There is
> no advantage for the user in the lambda implementation because I already
> extended BOOST_SCOPE_EXIT to use variadic macros, capture the object
> `this_`, and capture no variable (using `void`) all of which without using
> C++11 and maintaining backward compatibility with the existing
> BOOST_SCOPE_EXIT syntax.

If we assume that the new standard is immutable, then you reasoning
makes perfect sense. However, what if it was an oversight by the
standard committee? 'this' is not a local variable, after all. If they
allowed a special case for this, they could also allow data members.

Alex


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk