Skip to content

[Advance] 闭包捕获变量顺序 #6

Description

@ZhangHanDong
let c = move || {
        {
            let y_ref = &y;
        }
        x; y; z;
    };

假如x、y、z都是外部变量,那么上面闭包示例中,是先捕获y呢,还是先捕获z ?析构顺序是什么样的?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions