since there are some collection related discussions active, it’s probably a good time to bring weak reference collections up.
Sometimes weak collections are needed / better to avoid reference cycles. At the moment this can be only done using Objective-C frameworks or creating a wrapper object. In my opinion the standard library should provide a way to use weak reference collections. This could also be done using a third party library, but I feel like it should be added to the standard library.
I could imagine:
let weakArray = [Weak<SomeObject>]() let weakArray = [weak SomeObject]() let weakArray = Array<SomeObject>.weakReferences()
The implementation should be done on base type, so that it can be used for arrays, sets, dictionaries and so on.
What do you think?