TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
..< operator is the half-open range operator in Swift. It constructs a mathematical range that includes its lower bound but strictly excludes its upper bound.
Syntax Forms
The operator functions in two distinct arities: binary (two-sided) and prefix (one-sided).Type Signatures and Protocols
The types generated by the..< operator depend on its arity. The generic Bound type provided to the operator must conform to the Comparable protocol.
- Binary Form: Evaluates to a
Range<Bound>structure. It requires both a lower and an upper bound. - Prefix Form: Evaluates to a
PartialRangeUpTo<Bound>structure. It requires only an upper bound, implicitly extending infinitely downward.
Evaluation Rules
- Bound Relationship: For the binary form, the
lowerBoundmust be less than or equal to theupperBound(lowerBound <= upperBound). A runtime crash occurs if the lower bound exceeds the upper bound. - Empty Ranges: If
lowerBoundis exactly equal toupperBound, the resultingRangeis empty. - Exclusivity: The
upperBoundis never a member of the resulting range. Evaluatingrange.contains(upperBound)will always returnfalse. - Postfix Restriction: Unlike the closed range operator (
...), the half-open range operator (..<) cannot be used as a postfix operator. Swift does not support a half-openPartialRangeFrombecause a range extending infinitely upward has no defined upper bound to exclude.
Master Swift with Deep Grasping Methodology!Learn More





