Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Lambdas - How to Capture Everything and Stay Sane

Meeting Cpp via YouTube

Overview

Google, IBM & Meta Certificates — All 10,000+ Courses at 40% Off
One annual plan covers every course and certificate on Coursera. 40% off for a limited time.
Get Full Access
Explore the intricacies of lambda captures in C++ through this comprehensive conference talk from Meeting C++ 2022. Delve into the complex and evolving rules governing lambda captures, starting with the fundamentals of what it means to capture into a lambda and the concept of closures. Discover which elements truly require capturing and why certain captured objects resist modification. Examine various capture types and learn to combine them effectively. Investigate how init captures enable more sophisticated behaviors, such as capturing move-only objects or by const references. Give special attention to capturing 'this' and address related lifetime issues in depth. Conclude by exploring advanced scenarios like capturing parameter packs and structured bindings. Gain a solid understanding of lambda internals and closure object design, empowering you to write more efficient captures and avoid common pitfalls. By the end of this 55-minute talk, equip yourself with the knowledge to confidently and effectively utilize lambda captures in your C++ code.

Syllabus

Lambdas, how to capture everything and stay sane - Dawid Zalewski - Meeting C++ 2022

Taught by

Meeting Cpp

Reviews

Start your review of Lambdas - How to Capture Everything and Stay Sane

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.