Contents

removeFirst()

Removes the first element of the set.

Declaration

@discardableResult mutating func removeFirst() -> Element

Return Value

A member of the set.

Discussion

Because a set is not an ordered collection, the “first” element may not be the first element that was added to the set. The set must not be empty.

See Also

Removing Elements