do not click

Meeting C++ 2024   |  Online   |  Training   |  Books   |  Survey   |  Job fair   |  Advertising   |  Jobposting   |  Login

Meeting C++ 2024 - Lambdas, uses and abuses

Conference | Live Schedule | Talks | Get your ticket | Set your timezone

Dawid Zalewski

On Day 3 at in Track A (Saphir Room)

Lambdas are the powerhouse of modern C++. It's hard to imagine applying a standard algorithm without writing a lambda expression. Sadly, despite their versatility, that's also where lambdas end up most of the time. Yet, there is so much more.
This talk is about discovering the hidden potential of lambda expressions. After going through a range of common, unusual, and often unexpected usage patterns of lambdas you'll be better equipped to apply them in your projects.

We'll start with a review of the lambda syntax, including the newest C++20 additions. While doing so, we'll identify the opportunities for using lambdas to simplify existing code. This will be followed by more advanced topics including immediately invoked lambda expressions or lambdas that return lambdas to achieve levels of indirection previously available only to fully fledged classes. Finally, we'll explore the fascinating technique of inheriting from lambdas and demonstrate how it enables powerful abstractions (composition, recursion, partial application) that make applying design patterns like the chain of responsibility with lambdas trivial.

Please login to comment

Comment from Marc Mutz at 2020-12-01 17:03:54

Our codebase now contains three classes that inherit from lambdas! Great talk. Immediately applicable in day-to-day work. Everyone that tells you otherwise needs to watch this talk and then take a deep look at their own lambda uses. Thanks, Dawid!

Copyright Meetingcpp GmbH Imprint Piwik Opt out Privacy Policy