Re: [swift-users] Default bounds subscript for BidirectionalCollection

2016-06-28 Thread Tim Vermeulen via swift-users
No problem! But no, count is correct. From the docs: “endIndex: The collection's "past the end" position---that is, the position one greater than the last valid subscript argument." > On 28 Jun 2016, at 22:45, Roy Henderson wrote: > > Definitely not trying to correct your code Tim - but, being

[swift-users] Default bounds subscript for BidirectionalCollection

2016-06-28 Thread Tim Vermeulen via swift-users
I expected the following code to compile: struct Wrapper: BidirectionalCollection { var elements: [Element] var startIndex: Int { return 0 } var endIndex: Int { return elements.count } func index(after index: Int) -> Int { return index + 1 } func index(before ind