Re:A Defer Mechanism for C
by cesarb on Monday December 14, 2020 @11:03AM
(#25419052)
IIRC, the problem with C++ is that you can declare anonymous object instances... With surprising results (the object is destroyed at the semicolon, instead of being destroyed at the end of the block).
[ Parent
| on HN ]
Sure, you can, but its still not the behaviour you'd expect and the problem in my example is that "if it looks like a declaration, it is", so "foo bar;" and "foo (bar);" can be the same thing.