The New Old Thing, of Fun with Lambdas
summary
Example code uses generic lambdas and variadic pack expansion capture and exposes divergent behavior: Clang prints 1 2 3 4, GCC prints 4 3 2 1, one build of MSVC shows 4 3 2 1 and an ARM-target build shows 1 2 3 4, and one compiler bug is fixed during testing. The claim is that C++ must mandate left-to-right evaluation (proposal for C++17), with a small potential cost on some architectures and a noticeable change in existing programs' behavior.
AI-written summary · about
chapters (4)
related talks
01h 10mThe Three Little Dots and the Big Bad Lambdas
57mC++: λ Demystified
01h 03mto pass and return, the story of functions, values and compilers
08mOn "simple" Optimizations
33mC++: Unexpected Behaviour
59mTaming Lambdas' uniqueness
01h 02mEmbedded Friendly C++: Features That Make a Difference
01h 09mFunctional Programming in C++
