Set (Swift)

E820426

Set (Swift) is a generic, unordered collection type in the Swift standard library that stores unique values of the same type with efficient membership and set-operation support.

All labels observed (2)

Label Occurrences
Set (Swift) canonical 2
Set (Swift type) 1

How this entity was disambiguated

Statements (54)

Predicate Object
instanceOf generic collection type
struct
value type
allowsDuplicates false
conformsTo Collection
CustomDebugStringConvertible
CustomStringConvertible
Decodable
Encodable
ExpressibleByArrayLiteral
Hashable
Sequence
SetAlgebra
defaultInitializer init()
definedIn Swift Standard Library
elementConstraint Hashable
genericParameter Element
hasProperty Hash-based storage
amortized O(1) insertions
amortized O(1) membership checks
amortized O(1) removals
initializer init(_:) from a sequence
init(arrayLiteral:) via array literal syntax
introducedIn Swift 1.0
isCopyOnWrite true
isOrdered false
isValueSemantics true
iterationOrder unspecified
literalSyntaxExample let s: Set<Int> = [1, 2, 3]
module Swift
mutatingMethod insert(_:) -> (inserted: Bool, memberAfterInsert: Element)
remove(_:) -> Element?
update(with:) -> Element?
property count: Int
first: Element?
isEmpty: Bool
stores unique values
subscriptAccess no index-based subscript
supportsOperation contains
insert
intersection
isDisjoint(with:)
isStrictSubset(of:)
isStrictSuperset(of:)
isSubset(of:)
isSuperset(of:)
membership test
remove
subtracting
symmetricDifference
union
useCase ensuring uniqueness in collections
modeling mathematical sets
testing membership efficiently

How these facts were elicited

Referenced by (3)

Full triples — surface form annotated when it differs from this entity's canonical label.

NSSet bridgedTo Set (Swift)
Sequence (Swift protocol) conformedToBy Set (Swift type)
subject linked to: Sequence
linked to: Set (Swift)
Dictionary (Swift) relatedType Set (Swift)