You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many standard library objects and containers still require close() to be called manually.
This is mostly alleviated with defer, but you still need to remember to close it.
This also isn't consistent with how some parallelization related modules have a =destroy hook.
Description
Provide destructors for standard library modules so cleanup is done automatically.
This should also simplify many parsers in the standard library since they all use std/streams and need to call close(); they also have many short functions that just opens a stream, then closes it two lines afterwards. Having a defer there breaks the succinct flow.
Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
The text was updated successfully, but these errors were encountered:
Summary
Many standard library objects and containers still require
close()
to be called manually.This is mostly alleviated with
defer
, but you still need to remember to close it.This also isn't consistent with how some parallelization related modules have a
=destroy
hook.Description
Provide destructors for standard library modules so cleanup is done automatically.
This should also simplify many parsers in the standard library since they all use
std/streams
and need to callclose()
; they also have many short functions that just opens a stream, then closes it two lines afterwards. Having adefer
there breaks the succinct flow.Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
The text was updated successfully, but these errors were encountered: