Operator: +=

operator += { associativity right precedence assignment }

Declarations

func +=(_: inout Double, rhs: Double)

Declaration

func +=(lhs: inout Double, rhs: Double)
func +=(_: inout Float, rhs: Float)

Declaration

func +=(lhs: inout Float, rhs: Float)
func +=(_: inout Float80, rhs: Float80)

Declaration

func +=(lhs: inout Float80, rhs: Float80)
func +=(_: inout Int, rhs: Int)

Declaration

func +=(lhs: inout Int, rhs: Int)
func +=(_: inout Int8, rhs: Int8)

Declaration

func +=(lhs: inout Int8, rhs: Int8)
func +=(_: inout Int16, rhs: Int16)

Declaration

func +=(lhs: inout Int16, rhs: Int16)
func +=(_: inout Int32, rhs: Int32)

Declaration

func +=(lhs: inout Int32, rhs: Int32)
func +=(_: inout Int64, rhs: Int64)

Declaration

func +=(lhs: inout Int64, rhs: Int64)
func +=(_: inout UInt, rhs: UInt)

Declaration

func +=(lhs: inout UInt, rhs: UInt)
func +=(_: inout UInt8, rhs: UInt8)

Declaration

func +=(lhs: inout UInt8, rhs: UInt8)
func +=(_: inout UInt16, rhs: UInt16)

Declaration

func +=(lhs: inout UInt16, rhs: UInt16)
func +=(_: inout UInt32, rhs: UInt32)

Declaration

func +=(lhs: inout UInt32, rhs: UInt32)
func +=(_: inout UInt64, rhs: UInt64)

Declaration

func +=(lhs: inout UInt64, rhs: UInt64)
func += <R, S where R : RangeReplaceableCollection, S : Sequence, R.Iterator.Element == S.Iterator.Element>(_: inout R, rhs: S)

Appends the elements of a sequence to a range-replaceable collection.

Use this operator to append the elements of a sequence to the end of range-replaceable collection with same Element type. This example appends the elements of a Range<Int> instance to an array of integers.

var numbers = [1, 2, 3, 4, 5]
numbers += 10...15
print(numbers)
// Prints "[1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15]"

Parameters: lhs: The array to append to. rhs: A collection or finite sequence.

Complexity: O(n), where n is the length of the resulting array.

Declaration

func +=<R, S where R : RangeReplaceableCollection, S : Sequence, R.Iterator.Element == S.Iterator.Element>(lhs: inout R, rhs: S)
func += <T where T : _IntegerArithmetic>(_: inout T, rhs: T)

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

Declaration

func +=<T where T : _IntegerArithmetic>(lhs: inout T, rhs: T)
func += <T where T : Arithmetic>(_: inout T, rhs: T)

Declaration

func +=<T where T : Arithmetic>(lhs: inout T, rhs: T)
func += <T where T : FloatingPoint>(_: inout T, rhs: T)

Declaration

func +=<T where T : FloatingPoint>(lhs: inout T, rhs: T)
func += <T where T : SignedInteger>(_: inout T, rhs: T.Stride)

Declaration

func +=<T where T : SignedInteger>(lhs: inout T, rhs: T.Stride)
func += <T where T : Strideable>(_: inout T, rhs: T.Stride)

Declaration

func +=<T where T : Strideable>(lhs: inout T, rhs: T.Stride)
func += <T where T : UnsignedInteger>(_: inout T, rhs: T._DisallowMixedSignArithmetic)

Declaration

func +=<T where T : UnsignedInteger>(lhs: inout T, rhs: T._DisallowMixedSignArithmetic)