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 ofsequence
Declaration
Swift
init<S : SequenceType where S.Generator.Element == Generator.Element>(_ sequence: S)
-
Remove
x
fromself
and return it if it was present. If not, returnnil
.Declaration
Swift
mutating func remove(x: Generator.Element) -> Generator.Element?
-
Insert
x
intoself
Declaration
Swift
mutating func insert(x: Generator.Element)
-
returns
true
iffself
containsx
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)