ConcurrentStack<T>.IEnumerable.GetEnumerator 方法

定义

返回循环访问集合的枚举器。Returns an enumerator that iterates through a collection.

 virtual System::Collections::IEnumerator ^ System.Collections.IEnumerable.GetEnumerator() = System::Collections::IEnumerable::GetEnumerator;
System.Collections.IEnumerator IEnumerable.GetEnumerator ();
Function GetEnumerator () As IEnumerator Implements IEnumerable.GetEnumerator

返回

可用于循环访问集合的 IEnumeratorAn IEnumerator that can be used to iterate through the collection.

实现

注解

枚举表示堆栈内容的时间点快照。The enumeration represents a moment-in-time snapshot of the contents of the stack. 在调用 GetEnumerator 之后,它不会反映对集合的任何更新。It does not reflect any updates to the collection after GetEnumerator was called. 枚举器可以安全地与堆栈中的读取和写入操作一起使用。The enumerator is safe to use concurrently with reads from and writes to the stack.

适用于