RangeExpression
A type that can be used to slice a collection.
protocol RangeExpression<Bound>
A type that conforms to RangeExpression
can convert itself to a Range<Bound>
of indices within a given collection.
Requirements
associatedtype Bound : Comparable
The type for which the expression describes a range.
func contains(Self
.Bound) -> Bool Returns a Boolean value indicating whether the given element is contained within the range expression.
func relative<C>(to: C
) -> Range<Self.Bound> Returns the range of indices described by this range expression within the given collection.
Citizens in Swift
Members
static func ~= (Self, Self
.Bound) -> Bool Returns a Boolean value indicating whether a value is included in a range.