on Tue Jul 05 2016, David Waite <david-AT-alkaline-solutions.com> wrote:

>> On Jul 1, 2016, at 9:59 AM, Matthew Johnson via swift-evolution 
>> <[email protected]> wrote:
>> 
>>> 
>>> On Jun 30, 2016, at 12:26 PM, Dave Abrahams <[email protected]> wrote:
>>> 
>>> Q: Why not allow endIndex to have a different type from startIndex?
>>> A: It appears to offer insufficient benefit for the associated
>>>  complexity in typical usage.  A classic use case that argues for a
>>>  different endIndex type is the null-terminated C string.  But you
>>>  can't index one of those safely without actually counting the length,
>>>  and once you've done that you can make the endIndex an Int.
>> 
>> It’s also worth nothing that we can use `Optional` with `nil` as the 
>> `endIndex` sentinel if necessary.
>
> I don’t believe this is true? Optional cannot support Equatable w/o
> generics changes. I believe we would need a different wrapper type.

Correct.

-- 
Dave
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to