Re: [swift-users] Range.count can abort

2016-04-16 Thread Jens Alfke via swift-users
> On Apr 16, 2016, at 12:53 PM, Dmitri Gribenko wrote: > > It needs to be a signed integer. And a signed integer needs a distance type > itself. Yeah, there’s an infinite regress implied there, since a distance type has to be one bit larger than its source type. The

Re: [swift-users] Range.count can abort

2016-04-16 Thread Dmitri Gribenko via swift-users
On Sat, Apr 16, 2016 at 8:29 AM, wrote: > Is there any reason that Distance has to be a simple Int? Since it’s defined > per-type, UInt64 could use a custom struct without impacting the performance > of other types: It needs to be a signed integer. And a signed integer

Re: [swift-users] Range.count can abort

2016-04-16 Thread David Sweeris via swift-users
Is there any reason that Distance has to be a simple Int? Since it’s defined per-type, UInt64 could use a custom struct without impacting the performance of other types: struct UInt64Distance : Comparable { //I'm not sure what else it needs to conform to var distance: UInt64 var