Bag
public struct Bag<Element>
An unordered, non-unique collection of values of type Element.
-
Insert the given value into
self, and return a token that can later be passed toremove(using:).Declaration
Swift
public mutating func insert(_ value: Element) -> RemovalTokenParameters
valueA value that will be inserted.
-
Remove a value, given the token returned from
insert().Note
If the value has already been removed, nothing happens.
Declaration
Swift
public mutating func remove(using token: RemovalToken)Parameters
tokenA token returned from a call to
insert().
-
Declaration
Swift
public var startIndex: Index -
Declaration
Swift
public var endIndex: Index -
Declaration
Swift
public func index(after i: Index) -> IndexParameters
iA valid index of the collection.
imust be less thanendIndex.Return Value
The index value immediately after
i. -
Declaration
Swift
public func makeIterator() -> BagIterator<Element>
View on GitHub
Install in Dash
Bag Struct Reference