isEmpty
A Boolean value indicating whether the range contains no elements.
var isEmpty: Bool { get }Because a closed range cannot represent an empty range, this property is always false.
A Boolean value indicating whether the range contains no elements.
var isEmpty: Bool { get }where Bound:ComparableBecause a closed range cannot represent an empty range, this property is always false.
import Swift@frozen struct ClosedRange<Bound> where Bound : ComparableAn interval from a lower bound up to, and including, an upper bound.
@frozen struct BoolA value type whose instances are either true or false.
protocol Comparable : EquatableA 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.
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(_ other: ClosedRange<Bound>) -> Bool Returns a Boolean value indicating whether the given closed range is contained within this closed range.
func contains(_ element: Bound) -> Bool Returns a Boolean value indicating whether the given element is contained within the range.
func overlaps(_ other: ClosedRange<Bound>) -> Bool Returns a Boolean value indicating whether this range and the given closed range contain an element in common.
func overlaps(_ other: Range<Bound>) -> Bool Returns a Boolean value indicating whether this range and the given range contain an element in common.
func relative<C>(to collection: C) -> Range<Bound> where Bound == C.Index, C : Collection