SortedSet<T>.GetEnumerator 方法

定义

返回循环访问 SortedSet<T> 的枚举数。Returns an enumerator that iterates through the SortedSet<T>.

public:
 System::Collections::Generic::SortedSet<T>::Enumerator GetEnumerator();
public System.Collections.Generic.SortedSet<T>.Enumerator GetEnumerator ();
member this.GetEnumerator : unit -> System.Collections.Generic.SortedSet<'T>.Enumerator
Public Function GetEnumerator () As SortedSet(Of T).Enumerator

返回

SortedSet<T>.Enumerator

返回一个按排序顺序循环访问 SortedSet<T> 的枚举数。An enumerator that iterates through the SortedSet<T> in sorted order.

注解

只要集合保持不变,枚举器就仍有效。An enumerator remains valid as long as the collection remains unchanged. 如果对集合所做的更改(如添加、修改或删除元素),则枚举器将失效且不可恢复,并且对或的下一个调用将 MoveNext IEnumerator.Reset 引发 InvalidOperationExceptionIf changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to MoveNext or IEnumerator.Reset throws an InvalidOperationException.

此方法是一种 O(log n) 操作。This method is an O(log n) operation.

适用于