Unexpected behaviour when implementing RangeReplaceableCollection in a class
Swift Forums
Unexpected behaviour when implementing RangeReplaceableCollection in a class
I have the following UndoableArray class which acts like a normal Array but also has undo support: public final class UndoableArray<Element>: RandomAccessCollection, RangeReplaceableCollection { public typealias Index = Array<Element>.Index private(set) var elements: [Element] public init() { self.elements = [] } public init<S>(_ elements: S) where S: Sequence, Element == S.Element { self.elements = Array(elements) } public var startIndex...
0 comments
No comments yet.