Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auto create_closure = [](int x) {
- return [=]() {
- std::cout << "Number passed into the closure is: " << x << std::endl;
- };
- };
- auto closure = create_closure(42);
- send(closure.serialize());
- char *raw = receive();
- // Does not exist, but this is what I would like:
- auto closure = std::function<void()>::load(raw);
- // Should print "Number passed into the closure is: 42"
- closure();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement