insert(_:at:)
Insert a new usage
to this set at the specified index, if self
doesn’t already contain it.
@discardableResult mutating func insert(_ usage: Element, at index: Int) -> (inserted: Bool, index: Int)
Parameters
Returns
A pair (inserted, index)
, where inserted
is a Boolean value indicating whether the operation added a new element, and index
is the index of item
in the resulting set. If inserted
is false, then the returned index
may be different from the index requested.