Challenge 2: Capture-by-Value vs. Capture-by-Reference, Observed — Possible Solution ==================================================================== #include int main() { int x = 10; auto byValue = [x]() { std::cout << "by value: " << x << std::endl; }; auto byRef = [&x]() { std::cout << "by reference: " << x << std::endl; }; x = 99; byValue(); byRef(); return 0; } Output: by value: 10 by reference: 99 Explanation: byValue captured x BY VALUE, which -- per the chapter -- copies x's value into the lambda's own hidden member field at the moment the lambda is CREATED (when x was still 10), not when it's later called. Changing x to 99 afterward has no effect on that already- copied field, so byValue() still reports the old value, 10. byRef captured x BY REFERENCE instead, meaning its hidden member field stores a reference to x itself, not a copy of its value at creation time. When byRef() is later called, it reads x's CURRENT value at call time, which by then is 99, reflecting the change made in between. WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the exact "captures copy at creation time, not call time" detail the chapter calls out as sometimes-surprising, showing concretely how the same variable's later modification is visible through one capture mode (by reference) but not the other (by value).