UnorderedPair

public struct UnorderedPair<T> : SymmetricPair
extension UnorderedPair: CustomStringConvertible
extension UnorderedPair: Equatable where T: Equatable
extension UnorderedPair: Hashable where T: Hashable
extension UnorderedPair: Codable where T: Codable

Pair of two values of the same type for which the order of the values is not meaningful.

Instance Properties

  • a

    The first value contained herein.

    Declaration

    Swift

    public let a: T
  • b

    The second value contained herein.

    Declaration

    Swift

    public let b: T

Initializers

  • Creates an UnrderedPair with the given values.

    Declaration

    Swift

    @inlinable
    public init(_ a: T, _ b: T)

CustomStringConvertible

  • Printable description of UnorderedPair.

    Declaration

    Swift

    public var description: String { get }

Available where T: Equatable

  • Declaration

    Swift

    @inlinable
    public func other(_ value: T) -> T?

    Return Value

    The value in this UnorderedPair other than the given value, if the given value is contained herein. Otherwise, nil.

Equatable

  • Declaration

    Swift

    @inlinable
    public static func == (lhs: UnorderedPair, rhs: UnorderedPair) -> Bool

    Return Value

    true if both values contained by the given UnorderedPair values are equivalent, regardless of order. Otherwise, false.

Hashable

  • Implements hashable requirement.

    Declaration

    Swift

    @inlinable
    public func hash(into hasher: inout Hasher)