insert(_:at:)

Insert a new usage to this set at the specified index, if self doesn’t already contain it.

ExtendedKeyUsage.swift:162
@discardableResult mutating func insert(_ usage: Element, at index: Int) -> (inserted: Bool, index: Int)

Parameters

usage

The Usage to insert if not already present.

index

The index to insert usage if not already present.

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.