Possible Duplicate:
lambdas require capturing 'this' to call static member function?
I want to use c++11 lambda in a non-static member function and call a static member function of same class:
class A {
static void a() {}
public:
void x() {
[] () { A::a(); }();
}
};
But gcc4.6 and gcc4.7 both got an error: error: 'this' was not captured for this lambda function
Why does lambda need 'this' since 'a' is a static member function.
And if 'x' is static or 'a' is static member function of other class, 'this' is not necessary, why?