求解for_each (v.begin(), v.end(), [=,&str] (long l){})
求高手解答
下面代码中
[=,&str]
是什么意思
[code=C/C++][/code]
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
string str;
vector<long> v;
for_each (v.begin(), v.end(), [=,&str] (long l){});
return 0;
}
[解决办法]
C++11新增加的lambda表达式。