vector<int> Q;
bool (*compare)(int, int);
compare = [](int a, int b) {return a>b;}; //正确
compare = [=](int a, int b) {return Q[a]>Q[b];}; //报错
疑问
最新推荐文章于 2022-10-13 10:55:07 发布
vector<int> Q;
bool (*compare)(int, int);
compare = [](int a, int b) {return a>b;}; //正确
compare = [=](int a, int b) {return Q[a]>Q[b];}; //报错