1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <iostream> #include <functional> void f(int x, int y) { std::cout << x << " | " << y << std::endl; } template <class UnaryFunction> void g(UnaryFunction func) { func(100); } int main() { g(std::bind(f, 10, std::placeholders::_1)); } |
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnZvaWQgZihpbnQgeCwgaW50IHkpCnsKICAgIHN0ZDo6Y291dCA8PCB4IDw8ICIgfCAiIDw8IHkgPDwgc3RkOjplbmRsOwp9Cgp0ZW1wbGF0ZSA8Y2xhc3MgVW5hcnlGdW5jdGlvbj4Kdm9pZCBnKFVuYXJ5RnVuY3Rpb24gZnVuYykKewogICAgZnVuYygxMDApOwp9CgppbnQgbWFpbigpCnsKICBnKHN0ZDo6YmluZChmLCAxMCwgc3RkOjpwbGFjZWhvbGRlcnM6Ol8xKSk7Cn0=
-
upload with new input
-
result: Success time: 0s memory: 2828 kB returned value: 0
#include <iostream> #include <functional> void f(int x, int y) { std::cout << x << " | " << y << std::endl; } template <class UnaryFunction> void g(UnaryFunction func) { func(100); } int main() { g(std::bind(f, 11, std::placeholders::_1)); }10 | 100
-
result: Success time: 0s memory: 2828 kB returned value: 0
10 | 100


