logoalt Hacker News

Panzerschrektoday at 5:21 AM0 repliesview on HN

> If you didn't have that guarantee, at worst your mutex's guard object would be immediately dropped

For named local variables it's a different story. They should remain alive until the end of their lexical scope. But for unnamed temporaries created in expressions different rules should apply - as soon as there is no reference to such temporary, it should be destroyed.