Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Member group

.ctor

Declaring type: HashSet<T>
Module: System.Collections
Assembly: System.Runtime.dll
Source file: HashSet.rvn

Overloads / Variants

.ctor

init(comparer: EqualityComparer<T>) -> void

Source file: HashSet.rvn

Creates an empty set. Reentrant comparer callbacks fault.

Parameters

Name Type Description
comparer EqualityComparer<T> Stable equality/hash policy. Equal values must have equal hashes; stored values must not change equality or hash.

.ctor

init(items: Iterable<T>, comparer: EqualityComparer<T>) -> void

Source file: HashSet.rvn

Copies distinct elements using an explicit equality policy.

Parameters

Name Type Description
items Iterable<T> An iterable to consume once, including sequences and query results.
comparer EqualityComparer<T> Stable equality and hash policy; never inferred from the source.

Remarks

Native development API. Eager shallow copy with independent storage. Duplicate elements are ignored under comparer. Disposes the iterator on normal completion; provider Faults are terminal without guaranteed cleanup. No concurrent snapshot guarantee.