Closed swoolcock closed 4 years ago
class Foo: Disposable { func dispose() { // do something that would normally appear in a defer such as closing a file handle } } using(Foo()) { foo in // do something with foo } // dispose() has been automatically called