Contents

init(_:)

Creates an instance equivalent to the given Range.

Declaration

init(_ other: Range<Bound>)

Parameters

  • other:

    A Range to convert to a ClosedRange instance.

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.