Having a class like this:
class A { public: bool hasGrandChild() const; private: bool hasChild() const; vector children_; };
It isn't possible because the lambda is not a part of the class. It's the same as making an out-of-class function, and calling it instead of creating a lambda. Of course it doesn't have access to private members.