ImmutableSortedSet<T>.Enumerator 结构

定义

枚举二进制树的内容。Enumerates the contents of a binary tree.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public: value class ImmutableSortedSet<T>::Enumerator : System::Collections::Generic::IEnumerator<T>
public struct ImmutableSortedSet<T>.Enumerator : System.Collections.Generic.IEnumerator<T>
type ImmutableSortedSet<'T>.Enumerator = struct
    interface IEnumerator<'T>
    interface IEnumerator
    interface IDisposable
Public Structure ImmutableSortedSet(Of T).Enumerator
Implements IEnumerator(Of T)

类型参数

T
继承
ImmutableSortedSet<T>.Enumerator
实现

注解

此结构应与其他两个二进制树枚举器保持同步: System.Collections.Immutable.ImmutableList<T>.EnumeratorSystem.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.EnumeratorThis structure should be kept synchronized with the other two binary tree enumerators: System.Collections.Immutable.ImmutableList<T>.Enumerator and System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Enumerator.

注意

如果此枚举器用作值类型(即,如果它未装箱),请不要通过将其分配给第二个变量或通过将其传递到其他方法来复制它。When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. 当释放此枚举器时,它会将可变引用类型堆栈返回到资源池,并在复制值类型枚举器时(如果传递值,这可能很容易意外发生)。枚举器副本可能仍在使用资源池返回的资源池,从而导致数据损坏或异常。When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions.

属性

Current

获取枚举数当前位置的元素。Gets the element at the current position of the enumerator.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

方法

Dispose()

释放 ImmutableSortedSet<T>.Enumerator 类的当前实例使用的资源。Releases the resources used by the current instance of the ImmutableSortedSet<T>.Enumerator class.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

MoveNext()

将枚举器推进到不可变排序集的下一个元素。Advances the enumerator to the next element of the immutable sorted set.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

Reset()

将枚举器设置到其初始位置,该位置位于不可变排序集内的第一个元素之前。Sets the enumerator to its initial position, which is before the first element in the immutable sorted set.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

显式接口实现

IEnumerator.Current

当前元素。The current element.

适用于

线程安全性

此类型是线程安全的。This type is thread safe.