SetType

Conforming types should have efficient remove, insert, and contains methods. Conforming types get set-like methods - union, etc.

  • Create an empty instance of self

    Declaration

    Swift

    init()
  • Create an instance of self containing the elements of sequence

    Declaration

    Swift

    init<S : SequenceType where S.Generator.Element == Generator.Element>(_ sequence: S)
  • Remove x from self and return it if it was present. If not, return nil.

    Declaration

    Swift

    mutating func remove(x: Generator.Element) -> Generator.Element?
  • Insert x into self

    Declaration

    Swift

    mutating func insert(x: Generator.Element)
  • returns true iff self contains x

    Declaration

    Swift

    func contains(x: Generator.Element) -> Bool
  • Remove the member if it was present, insert it if it was not.

    Declaration

    Swift

    mutating func XOR(x: Generator.Element)