Operator: +

  • operator + {
  •                  associativity left
  •                  precedence
  •                  }

Declarations

func +(_: Double, rhs: Double)

Declaration

func +(_: Float, rhs: Float)

Declaration

func +(_: Float80, rhs: Float80)

Declaration

func +(_: Int, rhs: Int)

Declaration

func +(_: Int8, rhs: Int8)

Declaration

func +(_: Int16, rhs: Int16)

Declaration

func +(_: Int32, rhs: Int32)

Declaration

func +(_: Int64, rhs: Int64)

Declaration

func +(_: UInt, rhs: UInt)

Declaration

func +(_: UInt8, rhs: UInt8)

Declaration

func +(_: UInt16, rhs: UInt16)

Declaration

func +(_: UInt32, rhs: UInt32)

Declaration

func +(_: UInt64, rhs: UInt64)

Declaration

func + <C : RangeReplaceableCollection, S : Sequence where S.Iterator.Element == C.Iterator.Element>(_: C, rhs: S)

Creates a new collection by concatenating the elements of a collection and a sequence.

The two arguments must have the same Element type. For example, you can concatenate the elements of an integer array and a Range<Int> instance.

  • let numbers = [1, 2, 3, 4]
  • let moreNumbers = numbers + 5...10
  • print(moreNumbers)
  • // Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"

The resulting collection has the type of the argument on the left-hand side. In the example above, moreNumbers has the same type as numbers, which is [Int].

Parameters: lhs: A range-replaceable collection. rhs: A collection or finite sequence.

Declaration

func + <C : RangeReplaceableCollection, S : Sequence where S.Iterator.Element == C.Iterator.Element>(_: S, rhs: C)

Creates a new collection by concatenating the elements of a sequence and a collection.

The two arguments must have the same Element type. For example, you can concatenate the elements of a Range<Int> instance and an integer array.

  • let numbers = [7, 8, 9, 10]
  • let moreNumbers = 1...6 + numbers
  • print(moreNumbers)
  • // Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"

The resulting collection has the type of argument on the right-hand side. In the example above, moreNumbers has the same type as numbers, which is [Int].

Parameters: lhs: A collection or finite sequence. rhs: A range-replaceable collection.

Declaration

func + <Pointee>(_: Int, rhs: UnsafePointer<Pointee>)

Declaration

func + <Pointee>(_: UnsafeMutablePointer<Pointee>, rhs: Int)

Note: The following family of operator overloads are redundant with Strideable. However, optimizer improvements are needed before they can be removed without affecting performance.

Declaration

func + <Pointee>(_: UnsafePointer<Pointee>, rhs: Int)

Note: The following family of operator overloads are redundant with Strideable. However, optimizer improvements are needed before they can be removed without affecting performance.

Declaration

func + <RRC1 : RangeReplaceableCollection, RRC2 : RangeReplaceableCollection where RRC1.Iterator.Element == RRC2.Iterator.Element>(_: RRC1, rhs: RRC2)

Creates a new collection by concatenating the elements of two collections.

The two arguments must have the same Element type. For example, you can concatenate the elements of two integer arrays.

  • let lowerNumbers = [1, 2, 3, 4]
  • let higherNumbers: ContiguousArray = [5, 6, 7, 8, 9, 10]
  • let allNumbers = lowerNumbers + higherNumbers
  • print(allNumbers)
  • // Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"

The resulting collection has the type of the argument on the left-hand side. In the example above, moreNumbers has the same type as numbers, which is [Int].

Parameters: lhs: A range-replaceable collection. rhs: Another range-replaceable collection.

Declaration

func + <T : _IntegerArithmetic>(_: T, rhs: T)

Adds lhs and rhs, returning the result and trapping in case of arithmetic overflow (except in -Ounchecked builds).

Declaration

func + <T : FloatingPoint>(_: T, rhs: T)

Declaration

func + <T : Strideable>(_: T, rhs: T.Stride)

Declaration

  • func +<T : Strideable>(lhs: T, rhs: T.Stride) -> T
func + <T : Strideable>(_: T.Stride, rhs: T)

Declaration

  • func +<T : Strideable>(lhs: T.Stride, rhs: T) -> T