Instance Methodswift 6.0.3Swift
overlaps(_:)
func overlaps(_ other: ClosedRange<Bound>) -> Bool
func overlaps(_ other: ClosedRange<Bound>) -> Bool
where Bound:Comparable
import Swift
@frozen struct ClosedRange<Bound> where Bound : Comparable
An interval from a lower bound up to, and including, an upper bound.
@frozen struct Bool
A value type whose instances are either true
or false
.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
var customMirror: Mirror { get }
var debugDescription: String { get }
A textual representation of the range, suitable for debugging.
var description: String { get }
A textual representation of the range.
var isEmpty: Bool { get }
A Boolean value indicating whether the range contains no elements.
static func == (lhs: ClosedRange<Bound>, rhs: ClosedRange<Bound>) -> Bool
Returns a Boolean value indicating whether two ranges are equal.
func clamped(to limits: ClosedRange<Bound>) -> ClosedRange<Bound>
Returns a copy of this range clamped to the given limiting range.
func contains(_ element: Bound) -> Bool
Returns a Boolean value indicating whether the given element is contained within the range.
func overlaps(_ other: Range<Bound>) -> Bool
func relative<C>(to collection: C) -> Range<Bound> where Bound == C.Index, C : Collection