Addable
public protocol Addable
A type that can be used with +(_:_:).
The precise behaviour of + depends on the conforming type. It may be arithmetic addition, string concatenation, etc.
Conformance Requirements:
static func += (lhs: inout Self, rhs: Self)
-
+(_:_:)Default implementationReturns the sum, concatenation, or the result of a similar operation on two values implied by the “+” symbol. Exact behaviour depends on the type.
Mutating variant
+=
Default Implementation
Returns the sum of the two values.
Mutating variant
+=
Declaration
Swift
static func + (lhs: Self, rhs: Self) -> SelfParameters
lhsThe starting value.
rhsThe value to add.
-
+=(_:_:)Default implementationAdds or concatenates the right value to the left, or performs a similar operation implied by the “+” symbol. Exact behaviour depends on the type.
Nonmutating variant
+
Default Implementation
Adds the right value to the left.
Nonmutating variant
+
Declaration
Swift
static func += (lhs: inout Self, rhs: Self)Parameters
lhsThe value to modify.
rhsThe value to add.
View on GitHub
Addable Protocol Reference