tag:blogger.com,1999:blog-3197434572108789628.post8496146804263779759..comments2023-07-09T08:22:29.738-07:00Comments on c++ today: The Unbearable Lightness of a LambdaGaetanohttp://www.blogger.com/profile/03637292910769902384noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-3197434572108789628.post-44365399717855432482020-01-25T00:49:50.095-08:002020-01-25T00:49:50.095-08:00Thanks for pointing me that out. The solution is e...Thanks for pointing me that out. The solution is even simpler than that.Gaetanohttps://www.blogger.com/profile/03637292910769902384noreply@blogger.comtag:blogger.com,1999:blog-3197434572108789628.post-11396318343459585222020-01-24T18:54:42.109-08:002020-01-24T18:54:42.109-08:00This article implies that the compiler is allocati...This article implies that the compiler is allocating memory for the lambda when you capture too much data. I don't believe that is true. It is the conversion of the lambda to a std::function that is causing the allocation. Just passing the lambda as a template param (eg, like STL algorithms accept), should avoid the allocation in all cases.Anonymoushttps://www.blogger.com/profile/11088737581771543315noreply@blogger.com