News for hackers. Stuff that matters.
Re:The Evolutions of Lambdas in C++14, C++17 and C++20 by huhtenberg on Monday December 13, 2021 @10:41AM (#29540570)
You capture by value a variable that allocates and you get a heap allocation.
Re:The Evolutions of Lambdas in C++14, C++17 and C++20 by kllrnohj on Monday December 13, 2021 @11:14AM (#29540914)
That's dependent on the captured type's copy (or move) behavior, and is completely different from your claim that how the lambda is used can influence this. Lambdas themselves never heap allocate.