Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++move-capture lambdasSingle-choice MCQ

In an init-capture, what is the type and value category of `x` inside the lambda body here?

int v = 10; auto f = [x = v]() mutable { x += 1; return x; }; // what is x, and does calling f() twice affect v?