r/cpp • • 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

33 comments sorted by

View all comments

Show parent comment

1

u/drinkwater_ergo_sum May 09 '26

Thank you for your reply. I've never seen && qualified member functions in the code base I've been working in, so making them visible wasn't on my radar. As for optimizing the expiring lvalues it is foreign concept for me, would be so kind as to point me to some articles or other sources i could read up on?

2

u/javascript May 09 '26

I'm not aware of any resources but if you find some please send them my way too :)

1

u/Gorzoid May 09 '26

Yeah at work we generally do std::move(my_value.foo()) simply because it's more likely to work as expected when x doesn't have ref qualified accessors