On Monday, 27 April 2020 at 13:29:08 UTC, lilijreey wrote:
Hi:In dlang core.thread.osthread has below code, the 654 line code i can understand why write () first, and {m_fn = fn;}() do what?
The stdlib uses that pattern from time to time to indicate an unsafe block in an otherwise safe function.
Specifically it is a little trusted inline function being immediately called.
It is something that should be avoided whenever you can.