We realized we neglected to propose this useful API:

    /// Conversion from one range to another.
    extension RangeProtocol where Bound : Strideable, Bound.Stride : Integer {
      /// Creates an instance equivalent to `other`.
      ///
      /// - Precondition: an equivalent range is representable as an
      ///   instance of `Self`.  For example, `Range(0...Int.max)`
      ///   violates this precondition because an equivalent `Range<Int>`
      ///   would need an `upperBound` equal to `Int.max + 1`, which
      ///   is unrepresentable as an `Int`.
      public init<Other: RangeProtocol where Other.Bound == Bound>(_ other: 
Other)
    }

Please consider it added to the proposal, per
https://github.com/apple/swift-evolution/pull/255/.

-- 
Dave

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

Reply via email to