Lambdas - from C++11 to C++20

preview_player
Показать описание
In this Bits of Q tutorial we will be talking about Lambdas. Lambdas are anonymous functions that can be declared in line. They were added in C++11 and work really well when combined with standard library algorithms or when writing asynchronous or event driven code.

Related material:

Type deduction:
Part 1: Template & auto type deduction:

Part 2: decltype, Lambda captures and return type deduction:

Perfect forwarding:

-- TIMESTAMPS --
00:00 - Introduction
00:21 - Motivation and pre-C++11 approach
01:28 - Functors
02:37 - Lambdas
04:26 - Lambda captures
06:48 - Mutable lambdas
07:44 - Generic lambdas
09:05 - This in lambdas
09:47 - Passing and storing lambdas
10:51 - Summary

Outro music by lesfm from pixabay.

If you have any questions or feedback, just leave a comment below.

See you next time!
Рекомендации по теме