Consider the following code:
std::function<void()> bind_arg(int&& arg) {
return [arg]() {
std::cout << arg << std::endl;
}
}
Does this code bind arg
by value or by rvalue reference? (That is, is this safe, or does it bind a dangling reference?)