SetType
Conforming types should have efficient remove, insert, and contains methods.
Conforming types get set-like methods - union, etc.
-
Create an empty instance of
selfDeclaration
Swift
init() -
Create an instance of
selfcontaining the elements ofsequenceDeclaration
Swift
init<S : SequenceType where S.Generator.Element == Generator.Element>(_ sequence: S) -
Remove
xfromselfand return it if it was present. If not, returnnil.Declaration
Swift
mutating func remove(x: Generator.Element) -> Generator.Element? -
Insert
xintoselfDeclaration
Swift
mutating func insert(x: Generator.Element) -
returns
trueiffselfcontainsxDeclaration
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)
View on GitHub
SetType Protocol Reference