C++ Lambda Idioms - Timur Doumler - CppNorth 2022
ฝัง
- เผยแพร่เมื่อ 26 ส.ค. 2024
- CppNorth Twitter: / cppnorth
CppNorth Website: cppnorth.ca/
---
C++ Lambda Idioms - Timur Doumler - CppNorth 2022
Slides: github.com/Cpp...
CppNorth 2022 video sponsors:
think-cell: www.think-cell...
Adobe: cppatadobe.spl...
Ever since they were introduced in C++11, lambdas have been an essential language feature. Each subsequent standard added more functionality: we got generic lambdas and init captures in C++14, constexpr lambdas in C++17, default-construction and assignment, explicit template arguments and more in C++20, and even more possibilities are coming in the upcoming C++23 standard.
In this talk, we are looking at various interesting things you can do with lambdas. Some of these are well-established, useful idioms; others are lesser known, surprising tricks. Have you ever inherited from a lambda? Can you think of three different ways to call a lambda recursively? Do you know what happens if we assign an immediately-invoked lambda expression to a static variable? If not, then this talk is for you.
---
Timur Doumler
Timur Doumler is C++ Developer Advocate at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
---
TH-cam Channel Managed By Digital Medium Ltd: events.digital...
---
#Programming #CppNorth #lambda
Wow, this was quite an awesome journey:)
CLion fan here!
at 42:15 couldnt you just use `(auto i) requires std::integral`? or is i not in scope there
You could. In fact you could do it even more tersely with the abbreviated template syntax:
[](std::integral auto i) { ... }
13:25 what is this section... I feel like watching some meme video about java script
If you’re asking about the “odr-used” stuff, it’s indeed delicate. I believe it means that if the compiler doesn’t need an actual variable (or its address) because it knows its value it doesn’t capture it