#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include<functional>
using namespace std;
class person
{
public:
explicit person(const int& a,const string& b) :age(a), name(b) {};
void print() {
int a = 10;
int b = 20;
auto mylambda = [this,&a]() {
cout << this->age <<" "<<this->name<<endl;
cout << a << endl;
};
mylambda();
}
void print1(function<void(const int&)> a) {
a(10);
}
private:
int age;
string name;
};
lambda
最新推荐文章于 2023-08-30 13:25:34 发布