dfaure added a comment.
It's actually quite clear in my head, because I imagine the generated class. A captured variable in a lambda becomes a member variable. If it's a capture by value (which is what happens with [library]), it's a "plain value" member. So: bool Plugin::hasPlugin(const QString &library) { auto func = [&library](QObject* p) { return ...; }); } becomes bool Plugin::hasPlugin(const QString &library) { class Closure { bool operator(QObject *p) const { return ...; } QString library; }; auto func = Closure{library}; } or something like that. REPOSITORY R306 KParts REVISION DETAIL https://phabricator.kde.org/D24262 To: kossebau, dfaure Cc: dhaumann, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns