阅读背景:

为什么我不能捕获这个指针?

来源:互联网 

Consider the following code:

考虑下面的代码:

class A
{
public:
    void foo()
    {
        auto functor = [this]() 
            {
                A * a = this;
                auto functor = [a]() // The compiler won't accept "this" instead of "a"
                    {
                        a->bar();
                    };
            };
    }

    void bar() {}
};
class



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: