Skip to content

Instantly share code, notes, and snippets.

@KentarouKanno
Last active February 14, 2016 05:52
Show Gist options
  • Save KentarouKanno/79ca42bfd6568c16b9b8 to your computer and use it in GitHub Desktop.
Save KentarouKanno/79ca42bfd6568c16b9b8 to your computer and use it in GitHub Desktop.
Operator

Operator

★ 三項演算子

var a = 5

let result = a == 5 ? true : false
//=> ture

★ 宣言
・ prefix (前置演算子)

var num = 0
 ++num  

・ infix (二項演算子)

var num = 2 * 6

・ postfix(後置演算子)

var num = 0
num++  

★ 結合規則
・ left

(a + b) + c 

・ right

a + (b + c)

・ none // 規定値

a + b + c
[宣言: infix] operator [定義したい演算子: ~~] { associativity [結合規則: left] precedence [優先度: 110] }

// 優先度の規定値は100
// 後置演算子に優先度は無い

★ 演算子の宣言

infix operator ~> { associativity left precedence 255 }

infix operator << { associativity none precedence 160 }
infix operator >> { associativity none precedence 160 }

infix operator / { associativity left precedence 150 }
infix operator * { associativity left precedence 150 }
infix operator & { associativity left precedence 150 }
infix operator % { associativity left precedence 150 }
infix operator &* { associativity left precedence 150 }

infix operator | { associativity left precedence 140 }
infix operator - { associativity left precedence 140 }
infix operator + { associativity left precedence 140 }
infix operator ^ { associativity left precedence 140 }
infix operator &- { associativity left precedence 140 }
infix operator &+ { associativity left precedence 140 }

infix operator ..< { associativity none precedence 135 }
infix operator ... { associativity none precedence 135 }

infix operator ?? { associativity right precedence 131 }

infix operator > { associativity none precedence 130 }
infix operator < { associativity none precedence 130 }
infix operator == { associativity none precedence 130 }
infix operator >= { associativity none precedence 130 }
infix operator != { associativity none precedence 130 }
infix operator <= { associativity none precedence 130 }
infix operator ~= { associativity none precedence 130 }
infix operator !== { associativity none precedence 130 }
infix operator === { associativity none precedence 130 }

infix operator && { associativity left precedence 120 }

infix operator || { associativity left precedence 110 }

infix operator %= { associativity right precedence 90 assignment }
infix operator += { associativity right precedence 90 assignment }
infix operator |= { associativity right precedence 90 assignment }
infix operator -= { associativity right precedence 90 assignment }
infix operator /= { associativity right precedence 90 assignment }
infix operator *= { associativity right precedence 90 assignment }
infix operator &= { associativity right precedence 90 assignment }
infix operator ^= { associativity right precedence 90 assignment }
infix operator <<= { associativity right precedence 90 assignment }
infix operator >>= { associativity right precedence 90 assignment }

prefix operator ! {}
prefix operator + {}
prefix operator ~ {}
prefix operator - {}
prefix operator -- {}
prefix operator ++ {}
postfix operator ++ {}
postfix operator -- {}

★ 演算子のメソッド定義

@warn_unused_result
prefix public func !<T : BooleanType>(a: T) -> Bool

@warn_unused_result
prefix public func !(a: Bool) -> Bool

public func !=(lhs: Int32, rhs: Int32) -> Bool

@warn_unused_result
public func !=<T : Equatable>(lhs: T, rhs: T) -> Bool

/// Returns true if the arrays do not contain the same elements.
@warn_unused_result
public func !=<Element : Equatable>(lhs: ContiguousArray<Element>, rhs: ContiguousArray<Element>) -> Bool

/// Returns true if the arrays do not contain the same elements.
@warn_unused_result
public func !=<Element : Equatable>(lhs: ArraySlice<Element>, rhs: ArraySlice<Element>) -> Bool

@warn_unused_result
public func !=<T>(lhs: _OptionalNilComparisonType, rhs: T?) -> Bool

/// Returns true if the arrays do not contain the same elements.
@warn_unused_result
public func !=<Element : Equatable>(lhs: [Element], rhs: [Element]) -> Bool

/// Return `false` iff `t0` is identical to `t1`; i.e. if they are both
/// `nil` or they both represent the same type.
@warn_unused_result
public func !=(t0: Any.Type?, t1: Any.Type?) -> Bool

/// Returns `true` iff `lhs.rawValue != rhs.rawValue`.
@warn_unused_result
public func !=<T : RawRepresentable where T.RawValue : Equatable>(lhs: T, rhs: T) -> Bool

/// Returns `true` iff `lhs.rawValue != rhs.rawValue`.
@warn_unused_result
public func !=<T : Equatable where T : RawRepresentable, T.RawValue : Equatable>(lhs: T, rhs: T) -> Bool

public func !=(lhs: UInt8, rhs: UInt8) -> Bool

@warn_unused_result
public func !=<T>(lhs: T?, rhs: _OptionalNilComparisonType) -> Bool

@warn_unused_result
public func !=<T : Equatable>(lhs: T?, rhs: T?) -> Bool

@warn_unused_result
public func !=<Key : Equatable, Value : Equatable>(lhs: [Key : Value], rhs: [Key : Value]) -> Bool

public func !=(lhs: Int8, rhs: Int8) -> Bool
public func !=(lhs: UInt16, rhs: UInt16) -> Bool
public func !=(lhs: Int16, rhs: Int16) -> Bool
public func !=(lhs: UInt32, rhs: UInt32) -> Bool

@warn_unused_result
public func !=(lhs: Float80, rhs: Float80) -> Bool
public func !=(lhs: UInt64, rhs: UInt64) -> Bool
public func !=(lhs: Int64, rhs: Int64) -> Bool

@warn_unused_result
public func !=(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func !=(lhs: Float, rhs: Float) -> Bool
public func !=(lhs: Int, rhs: Int) -> Bool
public func !=(lhs: UInt, rhs: UInt) -> Bool

@warn_unused_result
public func !==(lhs: AnyObject?, rhs: AnyObject?) -> Bool

/// Returns false iff `lhs` and `rhs` store the same underlying collection.
@warn_unused_result
public func !==<L : AnyCollectionType, R : AnyCollectionType>(lhs: L, rhs: R) -> Bool

public func %(lhs: Int, rhs: Int) -> Int

@warn_unused_result
public func %(lhs: Float, rhs: Float) -> Float

@warn_unused_result
public func %(lhs: Double, rhs: Double) -> Double

@warn_unused_result
public func %(lhs: Float80, rhs: Float80) -> Float80

public func %(lhs: UInt, rhs: UInt) -> UInt

/// Divide `lhs` and `rhs`, returning the remainder and trapping in case of
/// arithmetic overflow (except in -Ounchecked builds).
@warn_unused_result
public func %<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

public func %(lhs: Int64, rhs: Int64) -> Int64
public func %(lhs: Int8, rhs: Int8) -> Int8
public func %(lhs: UInt64, rhs: UInt64) -> UInt64
public func %(lhs: Int32, rhs: Int32) -> Int32
public func %(lhs: UInt32, rhs: UInt32) -> UInt32
public func %(lhs: Int16, rhs: Int16) -> Int16
public func %(lhs: UInt16, rhs: UInt16) -> UInt16
public func %(lhs: UInt8, rhs: UInt8) -> UInt8

public func %=(inout lhs: Float, rhs: Float)
public func %=(inout lhs: Double, rhs: Double)
public func %=(inout lhs: Float80, rhs: Float80)

/// remainder `lhs` and `rhs` and store the result in `lhs`, trapping in
/// case of arithmetic overflow (except in -Ounchecked builds).
public func %=<T : _IntegerArithmeticType>(inout lhs: T, rhs: T)

public func &(lhs: Int, rhs: Int) -> Int
public func &(lhs: UInt, rhs: UInt) -> UInt
public func &(lhs: Int64, rhs: Int64) -> Int64
public func &(lhs: UInt64, rhs: UInt64) -> UInt64
public func &(lhs: Int32, rhs: Int32) -> Int32
public func &(lhs: UInt32, rhs: UInt32) -> UInt32
public func &(lhs: Int16, rhs: Int16) -> Int16
public func &(lhs: UInt16, rhs: UInt16) -> UInt16
public func &(lhs: Int8, rhs: Int8) -> Int8
public func &(lhs: UInt8, rhs: UInt8) -> UInt8

/// If `lhs` is `false`, return it.  Otherwise, evaluate `rhs` and
/// return its `boolValue`.
@warn_unused_result
public func &&<T : BooleanType, U : BooleanType>(lhs: T, @autoclosure rhs: () throws -> U) rethrows -> Bool

@warn_unused_result
public func &&<T : BooleanType>(lhs: T, @autoclosure rhs: () throws -> Bool) rethrows -> Bool

/// multiply `lhs` and `rhs`, silently discarding any overflow.
@warn_unused_result
public func &*<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

/// add `lhs` and `rhs`, silently discarding any overflow.
@warn_unused_result
public func &+<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

/// subtract `lhs` and `rhs`, silently discarding any overflow.
@warn_unused_result
public func &-<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

@warn_unused_result
public func &=<T : BitwiseOperationsType>(inout lhs: T, rhs: T)

public func &=(inout lhs: Int, rhs: Int)
public func &=(inout lhs: UInt, rhs: UInt)
public func &=(inout lhs: Int64, rhs: Int64)
public func &=(inout lhs: UInt64, rhs: UInt64)
public func &=(inout lhs: Int32, rhs: Int32)
public func &=(inout lhs: UInt32, rhs: UInt32)
public func &=(inout lhs: Int16, rhs: Int16)
public func &=(inout lhs: UInt16, rhs: UInt16)
public func &=(inout lhs: Int8, rhs: Int8)
public func &=(inout lhs: UInt8, rhs: UInt8)

@warn_unused_result
public func *(lhs: Float, rhs: Float) -> Float

/// Multiply `lhs` and `rhs`, returning a result and trapping in case of
/// arithmetic overflow (except in -Ounchecked builds).
@warn_unused_result
public func *<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

@warn_unused_result
public func *(lhs: Float80, rhs: Float80) -> Float80

@warn_unused_result
public func *(lhs: Double, rhs: Double) -> Double

public func *(lhs: UInt8, rhs: UInt8) -> UInt8
public func *(lhs: Int8, rhs: Int8) -> Int8
public func *(lhs: UInt16, rhs: UInt16) -> UInt16
public func *(lhs: Int16, rhs: Int16) -> Int16
public func *(lhs: UInt32, rhs: UInt32) -> UInt32
public func *(lhs: Int32, rhs: Int32) -> Int32
public func *(lhs: UInt64, rhs: UInt64) -> UInt64
public func *(lhs: Int, rhs: Int) -> Int
public func *(lhs: Int64, rhs: Int64) -> Int64
public func *(lhs: UInt, rhs: UInt) -> UInt

public func *=(inout lhs: UInt8, rhs: UInt8)
public func *=(inout lhs: Int8, rhs: Int8)
public func *=(inout lhs: UInt16, rhs: UInt16)
public func *=(inout lhs: Int16, rhs: Int16)
public func *=(inout lhs: UInt32, rhs: UInt32)
public func *=(inout lhs: Int32, rhs: Int32)
public func *=(inout lhs: UInt64, rhs: UInt64)
public func *=(inout lhs: Int64, rhs: Int64)
public func *=(inout lhs: UInt, rhs: UInt)
public func *=(inout lhs: Int, rhs: Int)
public func *=(inout lhs: Float, rhs: Float)
public func *=(inout lhs: Double, rhs: Double)
public func *=(inout lhs: Float80, rhs: Float80)

/// multiply `lhs` and `rhs` and store the result in `lhs`, trapping in
/// case of arithmetic overflow (except in -Ounchecked builds).
public func *=<T : _IntegerArithmeticType>(inout lhs: T, rhs: T)

public func +<T : UnsignedIntegerType>(lhs: T._DisallowMixedSignArithmetic, rhs: T) -> T
public func +<T : UnsignedIntegerType>(lhs: T, rhs: T._DisallowMixedSignArithmetic) -> T

public func +(lhs: UInt8, rhs: UInt8) -> UInt8
public func +(lhs: Int8, rhs: Int8) -> Int8
public func +(lhs: UInt16, rhs: UInt16) -> UInt16
public func +(lhs: Int16, rhs: Int16) -> Int16
public func +(lhs: UInt32, rhs: UInt32) -> UInt32
public func +(lhs: Int32, rhs: Int32) -> Int32
public func +(lhs: UInt64, rhs: UInt64) -> UInt64
public func +(lhs: Int64, rhs: Int64) -> Int64
public func +(lhs: UInt, rhs: UInt) -> UInt
public func +(lhs: Int, rhs: Int) -> Int

@warn_unused_result
prefix public func +(x: Float) -> Float

@warn_unused_result
public func +(lhs: Float, rhs: Float) -> Float

@warn_unused_result
prefix public func +(x: Double) -> Double

@warn_unused_result
public func +(lhs: Double, rhs: Double) -> Double

@warn_unused_result
prefix public func +(x: Float80) -> Float80

@warn_unused_result
public func +(lhs: Float80, rhs: Float80) -> Float80

/// Add `lhs` and `rhs`, returning a result and trapping in case of
/// arithmetic overflow (except in -Ounchecked builds).
@warn_unused_result
public func +<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

prefix public func +<T : SignedNumberType>(x: T) -> T

@warn_unused_result
public func +(lhs: String, rhs: String) -> String

@warn_unused_result
public func +<Memory>(lhs: UnsafeMutablePointer<Memory>, rhs: Int) -> UnsafeMutablePointer<Memory>

@warn_unused_result
public func +<Memory>(lhs: Int, rhs: UnsafeMutablePointer<Memory>) -> UnsafeMutablePointer<Memory>

@warn_unused_result
public func +<T : Strideable>(lhs: T.Stride, rhs: T) -> T

@warn_unused_result
public func +<T : Strideable>(lhs: T, rhs: T.Stride) -> T

@warn_unused_result
public func +<RRC1 : RangeReplaceableCollectionType, RRC2 : RangeReplaceableCollectionType where RRC1.Generator.Element == RRC2.Generator.Element>(lhs: RRC1, rhs: RRC2) -> RRC1

@warn_unused_result
public func +<C : RangeReplaceableCollectionType, S : CollectionType where S.Generator.Element == C.Generator.Element>(lhs: C, rhs: S) -> C

@warn_unused_result
public func +<Memory>(lhs: UnsafePointer<Memory>, rhs: Int) -> UnsafePointer<Memory>

@warn_unused_result
public func +<C : RangeReplaceableCollectionType, S : SequenceType where S.Generator.Element == C.Generator.Element>(lhs: S, rhs: C) -> C

@warn_unused_result
public func +<C : RangeReplaceableCollectionType, S : SequenceType where S.Generator.Element == C.Generator.Element>(lhs: C, rhs: S) -> C

@warn_unused_result
public func +<Memory>(lhs: Int, rhs: UnsafePointer<Memory>) -> UnsafePointer<Memory>

postfix public func ++(inout x: Int) -> Int
prefix public func ++(inout x: Int) -> Int
postfix public func ++(inout x: UInt) -> UInt
prefix public func ++(inout x: UInt) -> UInt
postfix public func ++(inout x: Int64) -> Int64
prefix public func ++(inout x: Int64) -> Int64
postfix public func ++(inout x: UInt64) -> UInt64
prefix public func ++(inout x: UInt64) -> UInt64
postfix public func ++(inout x: Int32) -> Int32
prefix public func ++(inout x: Int32) -> Int32
postfix public func ++(inout x: UInt32) -> UInt32
prefix public func ++(inout x: UInt32) -> UInt32
postfix public func ++(inout x: Int16) -> Int16
prefix public func ++(inout x: Int16) -> Int16
postfix public func ++(inout x: UInt16) -> UInt16
prefix public func ++(inout x: UInt16) -> UInt16
postfix public func ++(inout x: Int8) -> Int8
prefix public func ++(inout x: Int8) -> Int8
postfix public func ++(inout x: UInt8) -> UInt8
prefix public func ++(inout x: UInt8) -> UInt8
postfix public func ++(inout lhs: Double) -> Double
postfix public func ++(inout lhs: Float) -> Float
prefix public func ++(inout rhs: Double) -> Double
prefix public func ++(inout rhs: Float80) -> Float80
postfix public func ++(inout lhs: Float80) -> Float80

/// Replace `i` with its `successor()` and return the updated value of
/// `i`.
prefix public func ++<T : _Incrementable>(inout i: T) -> T

/// Replace `i` with its `successor()` and return the original
/// value of `i`.
postfix public func ++<T : _Incrementable>(inout i: T) -> T

prefix public func ++(inout rhs: Float) -> Float

public func +=<T : Strideable>(inout lhs: T, rhs: T.Stride)
public func +=<T : _IntegerArithmeticType>(inout lhs: T, rhs: T)
public func +=(inout lhs: Float80, rhs: Float80)
public func +=<Memory>(inout lhs: UnsafePointer<Memory>, rhs: Int)
public func +=(inout lhs: Double, rhs: Double)
public func +=<Memory>(inout lhs: UnsafeMutablePointer<Memory>, rhs: Int)
public func +=(inout lhs: Float, rhs: Float)
public func +=(inout lhs: Int, rhs: Int)
public func +=(inout lhs: UInt, rhs: UInt)
public func +=(inout lhs: Int64, rhs: Int64)
public func +=(inout lhs: UInt64, rhs: UInt64)
public func +=(inout lhs: Int32, rhs: Int32)
public func +=(inout lhs: UInt32, rhs: UInt32)
public func +=(inout lhs: Int16, rhs: Int16)
public func +=(inout lhs: UInt16, rhs: UInt16)
public func +=(inout lhs: Int8, rhs: Int8)
public func +=(inout lhs: UInt8, rhs: UInt8)

/// Append the elements of `rhs` to `lhs`.
public func +=<Element, C : CollectionType where C.Generator.Element == Element>(inout lhs: _ContiguousArrayBuffer<Element>, rhs: C)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, C : CollectionType where C.Generator.Element == Element>(inout lhs: [Element], rhs: C)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, S : SequenceType where S.Generator.Element == Element>(inout lhs: [Element], rhs: S)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, C : CollectionType where C.Generator.Element == Element>(inout lhs: ArraySlice<Element>, rhs: C)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, S : SequenceType where S.Generator.Element == Element>(inout lhs: ArraySlice<Element>, rhs: S)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, C : CollectionType where C.Generator.Element == Element>(inout lhs: ContiguousArray<Element>, rhs: C)

/// Extend `lhs` with the elements of `rhs`.
public func +=<Element, S : SequenceType where S.Generator.Element == Element>(inout lhs: ContiguousArray<Element>, rhs: S)

public func +=<T : UnsignedIntegerType>(inout lhs: T, rhs: T._DisallowMixedSignArithmetic)

public func +=(inout lhs: String, rhs: String)

public func -(lhs: Int8, rhs: Int8) -> Int8
public func -(lhs: UInt8, rhs: UInt8) -> UInt8
public func -(lhs: UInt16, rhs: UInt16) -> UInt16
public func -(lhs: Int16, rhs: Int16) -> Int16
public func -(lhs: UInt32, rhs: UInt32) -> UInt32
public func -(lhs: Int32, rhs: Int32) -> Int32
public func -(lhs: UInt64, rhs: UInt64) -> UInt64
public func -(lhs: Int64, rhs: Int64) -> Int64
public func -(lhs: UInt, rhs: UInt) -> UInt
public func -(lhs: Int, rhs: Int) -> Int

@warn_unused_result
prefix public func -(x: Float) -> Float

@warn_unused_result
public func -(lhs: Float, rhs: Float) -> Float

@warn_unused_result
prefix public func -(x: Double) -> Double

@warn_unused_result
public func -(lhs: Double, rhs: Double) -> Double

@warn_unused_result
prefix public func -(x: Float80) -> Float80

@warn_unused_result
public func -(lhs: Float80, rhs: Float80) -> Float80

/// Subtract `lhs` and `rhs`, returning a result and trapping in case of
/// arithmetic overflow (except in -Ounchecked builds).
@warn_unused_result
public func -<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

prefix public func -<T : SignedNumberType>(x: T) -> T

@warn_unused_result
public func -<T : Strideable>(lhs: T, rhs: T.Stride) -> T

public func -<T : _DisallowMixedSignArithmetic>(lhs: T, rhs: T) -> T._DisallowMixedSignArithmetic

@warn_unused_result
public func -<T : Strideable>(lhs: T, rhs: T) -> T.Stride

public func -<T : _DisallowMixedSignArithmetic>(lhs: T, rhs: T._DisallowMixedSignArithmetic) -> T

@warn_unused_result
public func -<Memory>(lhs: UnsafeMutablePointer<Memory>, rhs: Int) -> UnsafeMutablePointer<Memory>

@warn_unused_result
public func -<Memory>(lhs: UnsafePointer<Memory>, rhs: UnsafePointer<Memory>) -> Int

@warn_unused_result
public func -<Memory>(lhs: UnsafePointer<Memory>, rhs: Int) -> UnsafePointer<Memory>

@warn_unused_result
public func -<Memory>(lhs: UnsafeMutablePointer<Memory>, rhs: UnsafeMutablePointer<Memory>) -> Int

postfix public func --(inout x: UInt32) -> UInt32
prefix public func --(inout x: Int) -> Int
prefix public func --(inout x: UInt8) -> UInt8
postfix public func --(inout x: UInt8) -> UInt8

/// Replace `i` with its `predecessor()` and return the original
/// value of `i`.
postfix public func --<T : BidirectionalIndexType>(inout i: T) -> T

/// Replace `i` with its `predecessor()` and return the updated value
/// of `i`.
prefix public func --<T : BidirectionalIndexType>(inout i: T) -> T

postfix public func --(inout lhs: Float80) -> Float80
prefix public func --(inout rhs: Float80) -> Float80
prefix public func --(inout x: Int8) -> Int8
postfix public func --(inout x: Int8) -> Int8
prefix public func --(inout x: UInt16) -> UInt16
postfix public func --(inout lhs: Double) -> Double
prefix public func --(inout rhs: Double) -> Double
postfix public func --(inout x: UInt16) -> UInt16
prefix public func --(inout x: Int16) -> Int16
postfix public func --(inout x: Int16) -> Int16
prefix public func --(inout x: UInt32) -> UInt32
postfix public func --(inout lhs: Float) -> Float
prefix public func --(inout x: Int32) -> Int32
prefix public func --(inout rhs: Float) -> Float
postfix public func --(inout x: Int32) -> Int32
prefix public func --(inout x: UInt64) -> UInt64
postfix public func --(inout x: UInt64) -> UInt64
postfix public func --(inout x: Int) -> Int
prefix public func --(inout x: Int64) -> Int64
postfix public func --(inout x: Int64) -> Int64
prefix public func --(inout x: UInt) -> UInt
postfix public func --(inout x: UInt) -> UInt

public func -=(inout lhs: Float, rhs: Float)
public func -=(inout lhs: Int, rhs: Int)
public func -=(inout lhs: UInt16, rhs: UInt16)
public func -=(inout lhs: Double, rhs: Double)
public func -=(inout lhs: Float80, rhs: Float80)
public func -=(inout lhs: UInt, rhs: UInt)
public func -=(inout lhs: Int64, rhs: Int64)
public func -=(inout lhs: UInt64, rhs: UInt64)

/// subtract `lhs` and `rhs` and store the result in `lhs`, trapping in
/// case of arithmetic overflow (except in -Ounchecked builds).
public func -=<T : _IntegerArithmeticType>(inout lhs: T, rhs: T)

public func -=(inout lhs: Int32, rhs: Int32)

public func -=(inout lhs: UInt32, rhs: UInt32)

public func -=<T : Strideable>(inout lhs: T, rhs: T.Stride)

public func -=<T : UnsignedIntegerType>(inout lhs: T, rhs: T._DisallowMixedSignArithmetic)

public func -=<Memory>(inout lhs: UnsafeMutablePointer<Memory>, rhs: Int)

public func -=<Memory>(inout lhs: UnsafePointer<Memory>, rhs: Int)

public func -=(inout lhs: UInt8, rhs: UInt8)

public func -=(inout lhs: Int8, rhs: Int8)

public func -=(inout lhs: Int16, rhs: Int16)

/// Forms a closed range that contains both `start` and `end`.
/// - Requires: `start <= end`.
@warn_unused_result
public func ...<Pos : ForwardIndexType where Pos : Comparable>(start: Pos, end: Pos) -> Range<Pos>

/// Forms a closed range that contains both `minimum` and `maximum`.
@warn_unused_result
public func ...<Pos : ForwardIndexType>(minimum: Pos, maximum: Pos) -> Range<Pos>

/// Returns a closed interval from `start` through `end`.
@warn_unused_result
public func ...<Bound : Comparable>(start: Bound, end: Bound) -> ClosedInterval<Bound>

/// Forms a half-open range that contains `start`, but not `end`.
///
/// - Requires: `start <= end`.
@warn_unused_result
public func ..<<Pos : ForwardIndexType where Pos : Comparable>(start: Pos, end: Pos) -> Range<Pos>

/// Forms a half-open range that contains `minimum`, but not
/// `maximum`.
@warn_unused_result
public func ..<<Pos : ForwardIndexType>(minimum: Pos, maximum: Pos) -> Range<Pos>

/// Returns a half-open interval from `start` to `end`.
@warn_unused_result
public func ..<<Bound : Comparable>(start: Bound, end: Bound) -> HalfOpenInterval<Bound>

/// Divide `lhs` and `rhs`, returning a result and trapping in case of
/// arithmetic overflow (except in -Ounchecked builds).
@warn_unused_result
public func /<T : _IntegerArithmeticType>(lhs: T, rhs: T) -> T

@warn_unused_result
public func /(lhs: Float80, rhs: Float80) -> Float80

@warn_unused_result
public func /(lhs: Double, rhs: Double) -> Double

@warn_unused_result
public func /(lhs: Float, rhs: Float) -> Float

public func /(lhs: Int, rhs: Int) -> Int

public func /(lhs: UInt, rhs: UInt) -> UInt

public func /(lhs: Int64, rhs: Int64) -> Int64

public func /(lhs: UInt64, rhs: UInt64) -> UInt64

public func /(lhs: Int32, rhs: Int32) -> Int32

public func /(lhs: UInt32, rhs: UInt32) -> UInt32

public func /(lhs: Int16, rhs: Int16) -> Int16

public func /(lhs: UInt16, rhs: UInt16) -> UInt16

public func /(lhs: Int8, rhs: Int8) -> Int8

public func /(lhs: UInt8, rhs: UInt8) -> UInt8

public func /=(inout lhs: Float, rhs: Float)

public func /=(inout lhs: Double, rhs: Double)

public func /=(inout lhs: Float80, rhs: Float80)

/// divide `lhs` and `rhs` and store the result in `lhs`, trapping in
/// case of arithmetic overflow (except in -Ounchecked builds).
public func /=<T : _IntegerArithmeticType>(inout lhs: T, rhs: T)

@warn_unused_result
public func <<Element : Hashable>(lhs: SetIndex<Element>, rhs: SetIndex<Element>) -> Bool

@warn_unused_result
public func <(lhs: Bit, rhs: Bit) -> Bool

@warn_unused_result
public func <<Memory>(lhs: UnsafePointer<Memory>, rhs: UnsafePointer<Memory>) -> Bool

@warn_unused_result
public func <<Memory>(lhs: UnsafeMutablePointer<Memory>, rhs: UnsafeMutablePointer<Memory>) -> Bool

@warn_unused_result
public func <(lhs: UnicodeScalar, rhs: UnicodeScalar) -> Bool

@warn_unused_result
public func <(lhs: String.UTF16View.Index, rhs: String.UTF16View.Index) -> Bool

@warn_unused_result
public func <(lhs: String.UnicodeScalarView.Index, rhs: String.UnicodeScalarView.Index) -> Bool

@warn_unused_result
public func <(lhs: Index, rhs: Index) -> Bool

@warn_unused_result
public func <(lhs: String, rhs: String) -> Bool

/// Compare two `Strideable`s.
public func <<T : _Strideable>(x: T, y: T) -> Bool

@warn_unused_result
public func <(lhs: Character, rhs: Character) -> Bool

public func <(lhs: UInt8, rhs: UInt8) -> Bool

public func <(lhs: Int8, rhs: Int8) -> Bool

public func <(lhs: UInt16, rhs: UInt16) -> Bool

@warn_unused_result
public func <(lhs: ObjectIdentifier, rhs: ObjectIdentifier) -> Bool

public func <(lhs: Int16, rhs: Int16) -> Bool

public func <(lhs: UInt32, rhs: UInt32) -> Bool

public func <(lhs: Int32, rhs: Int32) -> Bool

public func <(lhs: UInt64, rhs: UInt64) -> Bool

public func <(lhs: Int64, rhs: Int64) -> Bool

public func <(lhs: UInt, rhs: UInt) -> Bool

public func <(lhs: Int, rhs: Int) -> Bool

@warn_unused_result
public func <(lhs: Float, rhs: Float) -> Bool

@warn_unused_result
public func <<T : Comparable>(lhs: T?, rhs: T?) -> Bool

@warn_unused_result
public func <(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func <(lhs: Float80, rhs: Float80) -> Bool

@warn_unused_result
public func <<Key : Hashable, Value>(lhs: DictionaryIndex<Key, Value>, rhs: DictionaryIndex<Key, Value>) -> Bool

public func <<(lhs: UInt64, rhs: UInt64) -> UInt64

public func <<(lhs: Int64, rhs: Int64) -> Int64

public func <<(lhs: UInt, rhs: UInt) -> UInt

public func <<(lhs: UInt8, rhs: UInt8) -> UInt8

public func <<(lhs: Int8, rhs: Int8) -> Int8

public func <<(lhs: UInt16, rhs: UInt16) -> UInt16

public func <<(lhs: Int16, rhs: Int16) -> Int16

public func <<(lhs: UInt32, rhs: UInt32) -> UInt32

public func <<(lhs: Int32, rhs: Int32) -> Int32

public func <<(lhs: Int, rhs: Int) -> Int

public func <<=(inout lhs: UInt8, rhs: UInt8)

public func <<=(inout lhs: Int8, rhs: Int8)

public func <<=(inout lhs: UInt16, rhs: UInt16)

public func <<=(inout lhs: Int16, rhs: Int16)

public func <<=(inout lhs: UInt32, rhs: UInt32)

public func <<=(inout lhs: Int32, rhs: Int32)

public func <<=(inout lhs: UInt64, rhs: UInt64)

public func <<=(inout lhs: Int64, rhs: Int64)

public func <<=(inout lhs: UInt, rhs: UInt)

public func <<=(inout lhs: Int, rhs: Int)

public func <=(lhs: UInt8, rhs: UInt8) -> Bool

@warn_unused_result
public func <=(lhs: Float, rhs: Float) -> Bool

public func <=(lhs: Int8, rhs: Int8) -> Bool

public func <=(lhs: Int32, rhs: Int32) -> Bool

public func <=(lhs: UInt16, rhs: UInt16) -> Bool

public func <=(lhs: Int16, rhs: Int16) -> Bool

public func <=(lhs: UInt64, rhs: UInt64) -> Bool

public func <=(lhs: Int64, rhs: Int64) -> Bool

public func <=(lhs: UInt, rhs: UInt) -> Bool

public func <=(lhs: Int, rhs: Int) -> Bool

@warn_unused_result
public func <=(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func <=(lhs: Float80, rhs: Float80) -> Bool

public func <=(lhs: UInt32, rhs: UInt32) -> Bool

@warn_unused_result
public func <=<T : Comparable>(lhs: T?, rhs: T?) -> Bool

@warn_unused_result
public func <=<T : Comparable>(lhs: T, rhs: T) -> Bool

/// Returns `true` iff `lhs` is identical to `rhs`.
@warn_unused_result
public func ==<Base : CollectionType>(lhs: LazyFilterIndex<Base>, rhs: LazyFilterIndex<Base>) -> Bool

@warn_unused_result
public func ==(lhs: Bit, rhs: Bit) -> Bool

/// Returns `true` iff `lhs.rawValue == rhs.rawValue`.
@warn_unused_result
public func ==<T : RawRepresentable where T.RawValue : Equatable>(lhs: T, rhs: T) -> Bool

@warn_unused_result
public func ==<T : Equatable>(lhs: T?, rhs: T?) -> Bool

/// Returns true if these arrays contain the same elements.
@warn_unused_result
public func ==<Element : Equatable>(lhs: ArraySlice<Element>, rhs: ArraySlice<Element>) -> Bool

/// Returns true if these arrays contain the same elements.
@warn_unused_result
public func ==<Element : Equatable>(lhs: [Element], rhs: [Element]) -> Bool

public func ==<Value, Element>(lhs: ManagedBufferPointer<Value, Element>, rhs: ManagedBufferPointer<Value, Element>) -> Bool

/// Return true iff `lhs` and `rhs` wrap equal underlying
/// `AnyBidirectionalIndex`s.
///
/// - Requires: The types of indices wrapped by `lhs` and `rhs` are
///   identical.
@warn_unused_result
public func ==(lhs: AnyBidirectionalIndex, rhs: AnyBidirectionalIndex) -> Bool

/// Two `HalfOpenInterval`s are equal if their `start` and `end` are equal.
@warn_unused_result
public func ==<Bound : Comparable>(lhs: HalfOpenInterval<Bound>, rhs: HalfOpenInterval<Bound>) -> Bool

public func ==(lhs: Int64, rhs: Int64) -> Bool

@warn_unused_result
public func ==(left: _SwiftNSOperatingSystemVersion, right: _SwiftNSOperatingSystemVersion) -> Bool

/// Two `ClosedInterval`s are equal if their `start` and `end` are equal.
@warn_unused_result
public func ==<Bound : Comparable>(lhs: ClosedInterval<Bound>, rhs: ClosedInterval<Bound>) -> Bool

/// Return true iff `lhs` and `rhs` wrap equal underlying
/// `AnyRandomAccessIndex`s.
///
/// - Requires: The types of indices wrapped by `lhs` and `rhs` are
///   identical.
@warn_unused_result
public func ==(lhs: AnyRandomAccessIndex, rhs: AnyRandomAccessIndex) -> Bool

@warn_unused_result
public func ==(x: ObjectIdentifier, y: ObjectIdentifier) -> Bool

@warn_unused_result
public func ==(lhs: Bool, rhs: Bool) -> Bool

@warn_unused_result
public func ==<T>(lhs: _OptionalNilComparisonType, rhs: T?) -> Bool

@warn_unused_result
public func ==(lhs: String.UTF16View.Index, rhs: String.UTF16View.Index) -> Bool

public func ==<T : _Strideable>(x: T, y: T) -> Bool

@warn_unused_result
public func ==(lhs: String, rhs: String) -> Bool

@warn_unused_result
public func ==(lhs: String.UTF8View.Index, rhs: String.UTF8View.Index) -> Bool

@warn_unused_result
public func ==(lhs: Index, rhs: Index) -> Bool

@warn_unused_result
public func ==<Memory>(lhs: UnsafePointer<Memory>, rhs: UnsafePointer<Memory>) -> Bool

@warn_unused_result
public func ==(lhs: UnicodeScalar, rhs: UnicodeScalar) -> Bool

@warn_unused_result
public func ==<Memory>(lhs: UnsafeMutablePointer<Memory>, rhs: UnsafeMutablePointer<Memory>) -> Bool

@warn_unused_result
public func ==(lhs: String.UnicodeScalarView.Index, rhs: String.UnicodeScalarView.Index) -> Bool

@warn_unused_result
public func ==<T>(lhs: T?, rhs: _OptionalNilComparisonType) -> Bool

@warn_unused_result
public func ==<Memory>(lhs: AutoreleasingUnsafeMutablePointer<Memory>, rhs: AutoreleasingUnsafeMutablePointer<Memory>) -> Bool

@warn_unused_result
public func ==(lhs: AnyForwardIndex, rhs: AnyForwardIndex) -> Bool

@warn_unused_result
public func ==<Value, Element>(lhs: _HeapBuffer<Value, Element>, rhs: _HeapBuffer<Value, Element>) -> Bool

@warn_unused_result
public func ==<Key : Hashable, Value>(lhs: DictionaryIndex<Key, Value>, rhs: DictionaryIndex<Key, Value>) -> Bool

@warn_unused_result
public func ==<Element>(lhs: Range<Element>, rhs: Range<Element>) -> Bool

@warn_unused_result
public func ==<Element : Hashable>(lhs: SetIndex<Element>, rhs: SetIndex<Element>) -> Bool

/// Return `true` iff `t0` is identical to `t1`; i.e. if they are both
/// `nil` or they both represent the same type.
@warn_unused_result
public func ==(t0: Any.Type?, t1: Any.Type?) -> Bool

@warn_unused_result
public func ==<Key : Equatable, Value : Equatable>(lhs: [Key : Value], rhs: [Key : Value]) -> Bool

@warn_unused_result
public func ==<Element : Hashable>(lhs: Set<Element>, rhs: Set<Element>) -> Bool

public func ==(lhs: UInt8, rhs: UInt8) -> Bool
public func ==(lhs: Int8, rhs: Int8) -> Bool
public func ==(lhs: UInt16, rhs: UInt16) -> Bool
public func ==(lhs: Int16, rhs: Int16) -> Bool
public func ==(lhs: UInt32, rhs: UInt32) -> Bool

public func ==(lhs: FloatingPointClassification, rhs: FloatingPointClassification) -> Bool

public func ==(lhs: Int32, rhs: Int32) -> Bool

@warn_unused_result
public func ==(lhs: COpaquePointer, rhs: COpaquePointer) -> Bool

@warn_unused_result
public func ==(lhs: Float80, rhs: Float80) -> Bool

public func ==(lhs: UInt64, rhs: UInt64) -> Bool

@warn_unused_result
public func ==(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func ==(lhs: Float, rhs: Float) -> Bool

@warn_unused_result
public func ==<BaseElements>(lhs: FlattenBidirectionalCollectionIndex<BaseElements>, rhs: FlattenBidirectionalCollectionIndex<BaseElements>) -> Bool

@warn_unused_result
public func ==<BaseElements>(lhs: FlattenCollectionIndex<BaseElements>, rhs: FlattenCollectionIndex<BaseElements>) -> Bool

public func ==(lhs: Int, rhs: Int) -> Bool

public func ==(lhs: UInt, rhs: UInt) -> Bool

/// Returns true if these arrays contain the same elements.
@warn_unused_result
public func ==<Element : Equatable>(lhs: ContiguousArray<Element>, rhs: ContiguousArray<Element>) -> Bool

@warn_unused_result
public func ==<Base>(lhs: ReverseIndex<Base>, rhs: ReverseIndex<Base>) -> Bool

@warn_unused_result
public func ==(lhs: Character, rhs: Character) -> Bool

@warn_unused_result
public func ===(lhs: AnyObject?, rhs: AnyObject?) -> Bool

/// Return true iff `lhs` and `rhs` store the same underlying collection.
@warn_unused_result
public func ===<L : AnyCollectionType, R : AnyCollectionType>(lhs: L, rhs: R) -> Bool

public func >(lhs: Int, rhs: Int) -> Bool

public func >(lhs: Int8, rhs: Int8) -> Bool

@warn_unused_result
public func ><T : Comparable>(lhs: T, rhs: T) -> Bool

@warn_unused_result
public func ><T : Comparable>(lhs: T?, rhs: T?) -> Bool

@warn_unused_result
public func >(lhs: Float80, rhs: Float80) -> Bool

@warn_unused_result
public func >(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func >(lhs: Float, rhs: Float) -> Bool

public func >(lhs: UInt, rhs: UInt) -> Bool
public func >(lhs: Int64, rhs: Int64) -> Bool
public func >(lhs: UInt64, rhs: UInt64) -> Bool
public func >(lhs: Int32, rhs: Int32) -> Bool
public func >(lhs: UInt32, rhs: UInt32) -> Bool
public func >(lhs: Int16, rhs: Int16) -> Bool
public func >(lhs: UInt16, rhs: UInt16) -> Bool
public func >(lhs: UInt8, rhs: UInt8) -> Bool

public func >=(lhs: UInt8, rhs: UInt8) -> Bool
public func >=(lhs: Int8, rhs: Int8) -> Bool
public func >=(lhs: UInt16, rhs: UInt16) -> Bool
public func >=(lhs: Int16, rhs: Int16) -> Bool
public func >=(lhs: UInt32, rhs: UInt32) -> Bool
public func >=(lhs: Int32, rhs: Int32) -> Bool
public func >=(lhs: UInt64, rhs: UInt64) -> Bool
public func >=(lhs: Int64, rhs: Int64) -> Bool
public func >=(lhs: UInt, rhs: UInt) -> Bool
public func >=(lhs: Int, rhs: Int) -> Bool

@warn_unused_result
public func >=(lhs: Float, rhs: Float) -> Bool

@warn_unused_result
public func >=(lhs: Double, rhs: Double) -> Bool

@warn_unused_result
public func >=(lhs: Float80, rhs: Float80) -> Bool

@warn_unused_result
public func >=<T : Comparable>(lhs: T?, rhs: T?) -> Bool

@warn_unused_result
public func >=<T : Comparable>(lhs: T, rhs: T) -> Bool

public func >>(lhs: Int8, rhs: Int8) -> Int8
public func >>(lhs: Int, rhs: Int) -> Int
public func >>(lhs: UInt, rhs: UInt) -> UInt
public func >>(lhs: Int64, rhs: Int64) -> Int64
public func >>(lhs: UInt64, rhs: UInt64) -> UInt64
public func >>(lhs: UInt8, rhs: UInt8) -> UInt8
public func >>(lhs: UInt16, rhs: UInt16) -> UInt16
public func >>(lhs: Int16, rhs: Int16) -> Int16
public func >>(lhs: Int32, rhs: Int32) -> Int32
public func >>(lhs: UInt32, rhs: UInt32) -> UInt32

public func >>=(inout lhs: UInt8, rhs: UInt8
public func >>=(inout lhs: Int8, rhs: Int8)
public func >>=(inout lhs: UInt16, rhs: UInt16)
public func >>=(inout lhs: Int16, rhs: Int16)
public func >>=(inout lhs: UInt32, rhs: UInt32)
public func >>=(inout lhs: Int32, rhs: Int32)
public func >>=(inout lhs: UInt64, rhs: UInt64)
public func >>=(inout lhs: Int64, rhs: Int64)
public func >>=(inout lhs: UInt, rhs: UInt)
public func >>=(inout lhs: Int, rhs: Int)

@warn_unused_result
public func ??<T>(optional: T?, @autoclosure defaultValue: () throws -> T?) rethrows -> T?

@warn_unused_result
public func ??<T>(optional: T?, @autoclosure defaultValue: () throws -> T) rethrows -> T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment