init(_:)
Creates an instance equivalent to the given Range.
Declaration
init(_ other: Range<Bound>)Parameters
- other:
A
Rangeto convert to aClosedRangeinstance.
Discussion
An equivalent range must be representable as a closed range. For example, passing an empty range as other triggers a runtime error, because an empty range cannot be represented by a closed range instance.