#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
struct MyClass {
void fun(int b, int c) const {
std::cout << a << " " << b << " " << c << std::endl;
}
MyClass(int _a) : a(_a) {}
private:
int a;
};
int main() {
std::vector<MyClass> v {10, 20, 30};
std::for_each(v.begin(), v.end(), [](const MyClass& m) { m.fun(3, 7); });
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCnN0cnVjdCBNeUNsYXNzIHsKCXZvaWQgZnVuKGludCBiLCBpbnQgYykgY29uc3QgewoJCXN0ZDo6Y291dCA8PCBhIDw8ICIgIiA8PCBiIDw8ICIgIiA8PCBjIDw8IHN0ZDo6ZW5kbDsKCX0KCU15Q2xhc3MoaW50IF9hKSA6IGEoX2EpIHt9CnByaXZhdGU6CiAgICBpbnQgYTsKfTsKCmludCBtYWluKCkgewoJc3RkOjp2ZWN0b3I8TXlDbGFzcz4gdiB7MTAsIDIwLCAzMH07CglzdGQ6OmZvcl9lYWNoKHYuYmVnaW4oKSwgdi5lbmQoKSwgW10oY29uc3QgTXlDbGFzcyYgbSkgeyBtLmZ1bigzLCA3KTsgfSk7CglyZXR1cm4gMDsKfQ==