> On Dec 2, 2017, at 12:28 PM, Cao, Jiannan via swift-dev <swift-dev@swift.org> > wrote: > > The question is that, whether the original Collection Protocol requires index > from lower to higher (startIndex < endIndex).
`Collection` does require that `startIndex <= endIndex`, and in general, that `i < c.index(after: i)` for all `i` in `c.startIndex ..< c.endIndex`. Unfortunately, this may not be explicitly documented anywhere. (Also unfortunately, `index(after:)` doesn't appear at all in Apple's documentation for `Collection`!) -- Brent Royal-Gordon Architechies
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev