init(_:)
Creates an instance equivalent to the given ClosedRange
.
init(_ other: ClosedRange<Bound>)
Parameters
- other
A closed range to convert to a
Range
instance.
An equivalent range must be representable as an instance of RangeInt.max
triggers a runtime error, because the resulting half-open range would require an upper bound of Int.max + 1
, which is not representable as an Int
.