ConcurrentStack<T>.GetEnumerator 方法

定义

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

public:
 virtual System::Collections::Generic::IEnumerator<T> ^ GetEnumerator();
public System.Collections.Generic.IEnumerator<T> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T>
Public Function GetEnumerator () As IEnumerator(Of T)

返回

用于 ConcurrentStack<T> 的枚举数。An enumerator for the ConcurrentStack<T>.

实现

注解

枚举表示堆栈内容的时间点快照。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. 枚举器返回 LIFO (后进先出)顺序中的项。The enumerator returns items in LIFO (last-in, first-out) order.

适用于

另请参阅