pfultz2/cppcheck

No dangling lifetime warning

Closed this issue · 0 comments

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;
        });
    };
}