Avatar
norio_nomura 1/14/2019 2:15 AM
BidirectionalCollectionLinkedListObjectで対応ですね。 extension LinkedListObject : BidirectionalCollection { public func index(before i: Index) -> Index { checkValidIndex(i) if i == endIndex { return Index(last) } precondition(i != startIndex, "Can't advance before startIndex") return Index(i.node?.previous) } }