I found this pitch from forever ago: Pitch: Deinit for structs
Now that references and ownership are being worked on, does that mean
deinit could finally be added to structs?
More powerful types without having to reach for reference counted classes sounds like a cool feature
Yes, this has been discussed extensively in the proposals. See "Destructuring methods for move-only types with
deinit" under Future Directions in SE-0366, for example. This is already partially supported behind a feature flag in the development toolchains (@Michael_Gottesman can tell you more on the implementation status).
Is that the
-enable-experimental-move-only flag or something else?
It doesn't seem like this flag allows move only structs with deinit on the toolchain from yesterday, unless the keyword is somehow different for now
*yeah I was forgetting the
It works thank you
There are still plenty of rough edges to sand down, any bugs you might report are much appreciated.
This was recently discussed here: