Table of Contents

Struct ValueDictionary<TKey, TValue>.ValuesEnumerator

Namespace
Badeend.ValueCollections
Assembly
Badeend.ValueCollections.dll

This type facilitates reading only the values of a dictionary.

public struct ValueDictionary<TKey, TValue>.ValuesEnumerator
Inherited Members

Remarks

This is a stack-allocated enumerator over the values in the dictionary.

To prevent accidental boxing, ValuesEnumerator does not implement any interface. If you want to use the values as a collection (e.g. IEnumerable<T>, IReadOnlyCollection<T>, etc.) you can still manually box it by calling AsCollection().

Properties

Current

Gets the element in the collection at the current position of the enumerator.

public readonly ref readonly TValue Current { get; }

Property Value

TValue

Methods

AsCollection()

Create a new heap-allocated view over the values in the dictionary.

public readonly ValueDictionary<TKey, TValue>.ValuesCollection AsCollection()

Returns

ValueDictionary<TKey, TValue>.ValuesCollection

Remarks

This method is an O(1) operation and allocates a new fixed-size collection instance. The items are not copied.

GetEnumerator()

Returns a new ValuesEnumerator.

Typically, you don't need to manually call this method, but instead use the built-in foreach syntax.

public readonly ValueDictionary<TKey, TValue>.ValuesEnumerator GetEnumerator()

Returns

ValueDictionary<TKey, TValue>.ValuesEnumerator

MoveNext()

Advances the enumerator to the next element of the collection.

public bool MoveNext()

Returns

bool