[=]
ラムダは、構文を使用して作成されたコンテキストからメンバーをキャプチャできます。this
ポインターのような状態参照がラムダに格納されている必要があると思います。
class Class
{
public:
void Function()
{
/*
* pass this lambda expression as parameter to another
* function and from there recover the this pointer which
* would be of the type Class* for further usage.
*/
[=](int)->int { /* do something with this->Member */ }
}
private:
int Member;
};
ラムダ式から参照ポインタを取得する方法はありますか?