2 Dec
2023
2 Dec
'23
3:37 p.m.
Andrey Semashev wrote:
I'm not opposed to renaming, as long as the new name is short and not misleading. I'm not familiar with Go (presumably, from which the name comes), so I can't tell how similar the semantics of the feature in Go is to the proposed library.
In Go, defer takes a function call expression: defer fclose( fp ); and captures the arguments as-if by value, evaluating them at the point of defer, not at the point where the function is called. It's like BOOST_SCOPE_FINAL std::bind( fclose, fp ); In Swift, defer takes a block: defer { fclose( fp ); } I have no idea what the capture semantics are there.