Struct ReadOnlyHashSet<T>
- Namespace
- Jitter2.DataStructures
- Assembly
- Jitter2.dll
A read-only wrapper around HashSet<T> that prevents modification while allowing enumeration and lookup.
public readonly struct ReadOnlyHashSet<T> : IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of elements in the set.
- Implements
-
IEnumerable<T>
- Inherited Members
Constructors
ReadOnlyHashSet(HashSet<T>)
A read-only wrapper around HashSet<T> that prevents modification while allowing enumeration and lookup.
public ReadOnlyHashSet(HashSet<T> hashset)
Parameters
hashsetHashSet<T>
Properties
Count
Gets the number of elements in the set.
public int Count { get; }
Property Value
Methods
Contains(T)
Determines whether the set contains the specified element.
public bool Contains(T item)
Parameters
itemT
Returns
CopyTo(T[])
Copies the elements of the set to an array.
public void CopyTo(T[] array)
Parameters
arrayT[]
CopyTo(T[], int)
Copies the elements of the set to an array, starting at a particular index.
public void CopyTo(T[] array, int arrayIndex)
Parameters
arrayT[]arrayIndexint
GetEnumerator()
public HashSet<T>.Enumerator GetEnumerator()