4、指定引用或复制
#include
usingnamespace std;
int main()
{
int i =1024, j =2048;
cout <<"outside i value:"<< i <<" addr:"<<&i << endl;
auto fun1 =[i]{
cout <<"inside i value:"<< i <<" addr:"<<&i << endl;
// cout << j << endl; // j 未捕获
};
fun1();
}