5
C++ has scope_exit for running code at scope exit. C# says "We have scope_exit at home." - The Old New Thing
(devblogs.microsoft.com)
A community about the C# programming language
Getting started
Useful resources
IDEs and code editors
Tools
Rules
Related communities
IDisposable is not that at all. At least not implicitly. It's a convention, one has to call Dispose to do anything. Edit: I might have misunderstood scope_exit 🥹