No dangling lifetime warning
Closed this issue · 0 comments
pfultz2 commented
auto f(std::vector<int> x) {
auto v = std::make_pair(x.begin(), x.end());
return [=]() {
std::for_each(v.first, v.second, [&](auto i) {
std::cout << i;
});
};
}