Lambda capture by value timing
What does this print?
#include <iostream>
#include <functional>
int main() {
int x = 1;
auto f = [=]() { return x; };
x = 42;
std::cout << f();
}
Sign in to answer questions and track your progress
Sign In