C++ Weekly - Ep 49 - Why Inherit From Lambdas?

preview_player
Показать описание
☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟

Upcoming Workshop: Applied constexpr: The Power of Compile-Time Resources, C++ Under The Sea, October 10, 2024

T-SHIRTS AVAILABLE!

WANT MORE JASON?

SUPPORT THE CHANNEL

GET INVOLVED

JASON'S BOOKS

► C++23 Best Practices

► C++ Best Practices

JASON'S PUZZLE BOOKS

► Object Lifetime Puzzlers Book 1

► Object Lifetime Puzzlers Book 2

► Object Lifetime Puzzlers Book 3

► Copy and Reference Puzzlers Book 1

► Copy and Reference Puzzlers Book 2

► Copy and Reference Puzzlers Book 3

► OpCode Puzzlers Book 1


RECOMMENDED BOOKS

AWESOME PROJECTS

O'Reilly VIDEOS

Рекомендации по теме
Комментарии
Автор

Keep up the awesome work Jason :D ...

macxfadz
Автор

Would it be better to use lambda with template auto parameter for dummy? : [ ] ( const auto&... ) { }

thegod
Автор

Somehow CTAD guide does not work with GCC.
I can see that g++-7 is used in the video, but if I replicate very similar example on godbolt I get an error that parameter pack sizes do not match:
Clang and MSVC work fine.
Any ideas? @Jason Turner

mmdk
Автор

Nice video. Why the std::for_each though? When you want to traverse the whole container, isn't it simpler to just use range based for loop?

brenogi
Автор

This video is from a long time ago. Do we still need template<typename ...T>?

amirghamarian
Автор

Sometime in between the time you made this video and the time I tested this, they somehow made the class template deduction guide you have stop working for gcc 7 snapshot. Since I do not yet know exactly how these guides are supposed to work, this may be a bug in the compiler, or a bug in your guide. Resorting to a make_visitor function works, but is a lot uglier.

Omnifarious
Автор

😢Honestly hard to understand, inherit from lambda and previous video ... Is there any other source with more details where I can learn ?

azadalishah
Автор

std::visit(visitor, v)... we've almost come full circle -- C++ is starting to look like C again. Haha

NathanielHourt