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

What does the init-capture do here, and what is the type of the captured member?

auto p = std::make_unique<int>(42); auto lam = [q = std::move(p)]() { return *q; }; // p is now empty; what is the type stored in the closure for q?