#include <iostream>
int main() {
    int factor = 2;
    const auto snapshot = [factor](int x) { return x * factor; };
    const auto borrowed = [&factor](int x) { return x * factor; };
    factor = 5;
    std::cout << "snapshot=" << snapshot(3)
              << " borrowed=" << borrowed(3) << '\n';
}
