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


Come to my Object Lifetime class at Core C++ 2019 https://corecpp.org/schedule/#session-11

Learning C++ Best Practices: http://shop.oreilly.com/product/0636920049814.do

Inheritance and Polymorphism with C++: http://shop.oreilly.com/product/0636920052166.do

Support these videos: https://www.patreon.com/lefticus

Follow me on twitter: https://twitter.com/lefticus

Source: https://godbolt.org/g/AD2eu3

Channel:  Jason Turner
Breno Guimarães 

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?

Nathan Hourt 

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



G. C. 

what compiler is it?

Eric Hopper 

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.

Илья Полищук 

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


Keep up the awesome work Jason :D ...