ConcurrentQueue<T>.GetEnumerator ConcurrentQueue<T>.GetEnumerator ConcurrentQueue<T>.GetEnumerator ConcurrentQueue<T>.GetEnumerator Method

定義

傳回在 ConcurrentQueue<T> 中逐一查看的列舉值。Returns an enumerator that iterates through the ConcurrentQueue<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)

傳回

ConcurrentQueue<T> 內容的列舉程式。An enumerator for the contents of the ConcurrentQueue<T>.

實作

備註

列舉代表佇列內容的時間點快照集。The enumeration represents a moment-in-time snapshot of the contents of the queue. 在呼叫之後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 queue.

列舉值會以它們的加入順序傳回集合元素, 這是 FIFO 順序 (先進先出)。The enumerator returns the collection elements in the order in which they were added, which is FIFO order (first-in, first-out).

適用於

另請參閱