Generic Operator

==(_:_:)

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

Declaration

func == <A, B, C, D, E>(lhs: (A, B, C, D, E), rhs: (A, B, C, D, E)) -> Bool where A : Equatable, B : Equatable, C : Equatable, D : Equatable, E : Equatable

Parameters

lhs

A tuple of Equatable elements.

rhs

Another tuple of elements of the same type as lhs.

Discussion

For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 5 components:

let a = ("a", 1, 2, 3, 4)
let b = ("a", 1, 2, 3, 4)
print(a == b)
// Prints "true"

let c = ("a", 1, 2, 3, 5)
print(a == c)
// Prints "false"

See Also

Tuple Comparison

func == ((), ()) -> Bool

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

func == <A, B>((A, B), (A, B)) -> Bool

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

func == <A, B, C>((A, B, C), (A, B, C)) -> Bool

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

func == <A, B, C, D>((A, B, C, D), (A, B, C, D)) -> Bool

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

func == <A, B, C, D, E, F>((A, B, C, D, E, F), (A, B, C, D, E, F)) -> Bool

Returns a Boolean value indicating whether the corresponding components of two tuples are equal.

func != ((), ()) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

func != <A, B>((A, B), (A, B)) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

func != <A, B, C>((A, B, C), (A, B, C)) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

func != <A, B, C, D>((A, B, C, D), (A, B, C, D)) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

func != <A, B, C, D, E>((A, B, C, D, E), (A, B, C, D, E)) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.

func != <A, B, C, D, E, F>((A, B, C, D, E, F), (A, B, C, D, E, F)) -> Bool

Returns a Boolean value indicating whether any corresponding components of the two tuples are not equal.