This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Using Lambda with variables in deriving class: Regression or not?
- From: Deniz Sarikaya <daimler3 at googlemail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 17 Feb 2012 11:30:38 +0100
- Subject: Using Lambda with variables in deriving class: Regression or not?
- References: <CAHN6VueidURvtamHUJQgc9+QCgsPJTTtSiTkXbOuMMBF2OQi7w@mail.gmail.com>
Hello,
I don't know if this is already known but in a member function, when I
use any variable of the derived class in a lambda,
I get the following error: capture of non-variable 'Derived::Class::variable'
It used to work with GCC (on version 4.6) but now with 4.7 it doesn't
work anymore.
As a workaround I turned
[&variable]() -> void
{
??? variable->memfunc();
}
to
[&]() -> void
{
??? variable->memfunc();
}
Did I do something wrong or why is this not working anymore?