3 ms·
Destructors bring about complications with lifetimes and move vs copy semantics among other things. Simple scope-based defers are trivially understandable (if y
by von_lohengramm 5y ago
Destructors bring about complications with lifetimes and move vs copy semantics among other things. Simple scope-based defers are trivially understandable (if you don't abuse text replace macros...) and are mostly just syntactic sugar allowing for better, more maintainable code in almost all codebases. IMO seeing such an overcomplicated version of defer even being considered for C is embarrassing to say the least.
- dataangel 5y agoC++ and Rust both have both move and copy semantics and destructors. What's the issue?