r/cpp • u/javascript • May 09 '26
Any good tech talks leveraging statement expressions?
Lambdas do a great job in a lot of cases but sometimes you need a statement expression. Any good content on youtube?
14
Upvotes
View all comments
Show parent comment
3
u/SirClueless May 09 '26
In my experience banning implicit captures is too cautious. Most lambdas are used for local control flow where it doesn’t matter. I work on a codebase where implicit captures are allowed but the style guide says not to use them for lambdas that escape. I don’t think I’ve ever seen an implicit capture cause problems but multiple show-stopping bugs due to explicit captures of a “this” that got moved.