on Fri Apr 08 2016, Erica Sadun <erica-AT-ericasadun.com> wrote:

>     On Apr 8, 2016, at 3:48 AM, tuuranton--- via swift-users
>     <swift-users@swift.org> wrote:
>
>         print(UInt8.min) //0
>
>     print(UInt8.max) //255
>
>         //Is there an easy way to loop between all values
>
>     //between (and including both) UInt8.min and UInt8.max?
>
>         //This doesn't work.
>
>     //Runtime crash because UInt8.max has no successor.
>
>     for i in UInt8.min...UInt8.max {
>
>     print(i)
>
>     }
>
> Easy? No. 

Yes!  It works in the swift-3-indexing-model branch.

-- 
Dave
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to