64,662
社区成员
发帖
与我相关
我的任务
分享
#include <algorithm>
#include <iostream>
#include <vector>
struct test
{
void print () const { std::cout << "test::print() of " << this << std::endl; }
};
int main ()
{
std::vector<test> vt(10);
std::for_each(vt.begin(),vt.end(),[](test const& t){t.print();});
return 0;
}