Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- postfix operator < {}
- postfix operator <= {}
- prefix operator > {}
- prefix operator >= {}
- postfix func < <C : Comparable>(lhs: C)(_ rhs: C) -> Bool {
- return lhs < rhs
- }
- postfix func <= <C : Comparable>(lhs: C)(_ rhs: C) -> Bool {
- return lhs <= rhs
- }
- prefix func > <C : Comparable>(lhs: C)(_ rhs: C) -> Bool {
- return rhs > lhs
- }
- prefix func >= <C : Comparable>(lhs: C)(_ rhs: C) -> Bool {
- return rhs >= lhs
- }
- [1, 2, 3, 4, 5].filter(4<) // [5]
- prefix operator ~= {}
- postfix operator ~= {}
- prefix func ~=<T>(lhs: _OptionalNilComparisonType)(_ rhs: T?) -> Bool {
- return lhs ~= rhs
- }
- prefix func ~=<T : Equatable>(a: T)( _ b: T) -> Bool {
- return a ~= b
- }
- prefix func ~=<I : ForwardIndexType where I : Comparable>(pattern: Range<I>)(_ value: I) -> Bool {
- return pattern ~= value
- }
- prefix func ~=<I : IntervalType>(pattern: I)(_ value: I.Bound) -> Bool {
- return pattern ~= value
- }
- postfix func ~=<T>(lhs: _OptionalNilComparisonType)(_ rhs: T?) -> Bool {
- return lhs ~= rhs
- }
- postfix func ~=<T : Equatable>(a: T)( _ b: T) -> Bool {
- return a ~= b
- }
- postfix func ~=<I : ForwardIndexType where I : Comparable>(pattern: Range<I>)(_ value: I) -> Bool {
- return pattern ~= value
- }
- postfix func ~=<I : IntervalType>(pattern: I)(_ value: I.Bound) -> Bool {
- return pattern ~= value
- }
- prefix operator == {}
- postfix operator == {}
- prefix func == <E : Equatable>(lhs: E)(_ rhs: E) -> Bool {
- return lhs == rhs
- }
- postfix func == <E : Equatable>(lhs: E)(_ rhs: E) -> Bool {
- return lhs == rhs
- }
- (0..<100).filter((5..<15)~=) // [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
- (0..<10 ).filter(==5) // [5]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement