Change method() into this->method() in lambda so g++ accepts it