#include #include std::function make_adder(int x1) { return [&x1]() { return x1 + 1; }; } int main() { auto add_one = make_adder(5); std::cout << add_one() << std::endl; // This will likely cause a crash or undefined behavior return 0; }