3 ms·
It's true it's less typing, but it's not too hard to engineer a macro on top of destructors to get defer behavior (C++ at least will let you define a type insid
by dataangel 5y ago
It's true it's less typing, but it's not too hard to engineer a macro on top of destructors to get defer behavior (C++ at least will let you define a type inside a function, so the macro can expand to a trivial type with a destructor containing the users code then make a dummy instance on the stack). It is however impossible to do it the other direction. Also no reason we can't have both.