API reference
API reference
Select your platform
No SDKs available
No versions available

IEnumerableHashSet Interface

Extends IEnumerable< T >
Exposes a GetEnumerator method with a non-allocating HashSet.Enumerator struct.
This is an advanced performance optimization for scenarios where an interface representation of a hash set is needed, but the allocations associated with boxing the enumerator as an IEnumerable<T> are problematic (for example, because of invocation in per-frame logic as in Interactable<TInteractor, TInteractable>). In general, iteration over concrete collection types avoids the need for this interface; but for scenarios where exposing the full contract of a HashSet would be improper (as again in Interactable<TInteractor, TInteractable>s, where Interactable<TInteractor, TInteractable>.Interactors should expose the ability to enumerate the collection without the ability to modify the collection), this interface and its implementing type EnumerableHashSet<T> can fulfill the required contract without unintended allocations.

Properties

Gets the number of elements that are contained in a set.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.

Member Functions

Returns a non-allocating enumerator that iterates through an IEnumerableHashSet<T> object.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object contains the specified element.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object is a proper subset of the specified collection.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object is a proper superset of the specified collection.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object is a subset of the specified collection.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object is a superset of the specified collection.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether the current IEnumerableHashSet<T> object and a specified collection share common elements.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.Overlaps. For more information, please consult the official documentation for HashSet.
Determines whether an IEnumerableHashSet<T> object and the specified collection contain the same elements.
The implementation of this method in EnumerableHashSet<T> is the built-in method HashSet<T>.SetEquals. For more information, please consult the official documentation for HashSet.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon