> 在 2016年7月17日,17:44,Tino Heth <[email protected]> 写道: > > >> What I hope to achieve is to have a Set of unique objects by their >> references. For example, I might put in two rectangles with the same height >> and width (which makes them equal, but they are still different instances). > I guess this is not the best place for such problems, but did you already > look at ObjectIdentifier? > > Tino >
The problem is the motivation for my proposal of adding ReferenceSet<Element: AnyObject> and ReferenceDictionary<Key: AnyObject, Value> to stdlib. The original object cannot be retrieved from ObjectIdentifier, which makes it unsuitable for my use-case. - Guoye Zhang _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
