#include <iostream>
using namespace std;
int main(){
int x = 1, y = 2;
auto p = [&] (int a, int b) mutable ->int {x++; return a + b + x + y;};
int c = p(1,2);
cout << c << endl;
cout << x << endl;
}
C++ lambda函数
最新推荐文章于 2024-08-16 16:51:12 发布