@@ -61,6 +61,7 @@ public protocol RangeProtocol : Equatable {
61
61
/// `lowerBound < x < upperBound`. `RangeProtocol` makes no requirement as
62
62
/// to whether individual range types must contain either their lower or
63
63
/// upper bound.
64
+ @warn_unused_result
64
65
func contains( _ value: Bound ) -> Bool
65
66
66
67
/// Returns `true` iff `self` and `other` contain a value in common.
@@ -105,6 +106,12 @@ extension RangeProtocol {
105
106
}
106
107
107
108
/// Returns `true` iff `self` and `other` contain a value in common.
109
+ ///
110
+ /// Any type of range contains every value `x` where
111
+ /// `lowerBound < x < upperBound`. `RangeProtocol` makes no requirement as
112
+ /// to whether individual range types must contain either their lower or
113
+ /// upper bound.
114
+ @warn_unused_result
108
115
@inline ( __always)
109
116
public func overlaps<
110
117
Other : RangeProtocol where Other. Bound == Bound
@@ -117,6 +124,7 @@ extension RangeProtocol {
117
124
///
118
125
/// The bounds of the result, even if it is empty, are always
119
126
/// limited to the bounds of `limits`.
127
+ @warn_unused_result
120
128
@inline ( __always)
121
129
public func clamped( to limits: Self ) -> Self {
122
130
return Self (
@@ -359,6 +367,7 @@ extension RangeProtocol {
359
367
/// Return true if this is not a closed range type.
360
368
///
361
369
/// - parameter x: any arbitrary value of type `Bound`.
370
+ @warn_unused_result
362
371
internal static func _isNotClosed( _ x: Bound ) -> Bool {
363
372
return Self ( uncheckedBounds: ( lower: x, upper: x) ) . isEmpty
364
373
}
@@ -640,7 +649,7 @@ public func ..< <
640
649
}
641
650
642
651
@warn_unused_result
643
- public func ~= < R: RangeProtocol > (
652
+ public func ~= < R : RangeProtocol > (
644
653
pattern: R , value: R . Bound
645
654
) -> Bool {
646
655
return pattern. contains ( value)
0 commit comments