IProducerConsumerCollection<T>.TryTake(T) 方法

定義

嘗試從 IProducerConsumerCollection<T> 中移除及傳回物件。

public:
 bool TryTake([Runtime::InteropServices::Out] T % item);
public bool TryTake (out T item);
abstract member TryTake : 'T -> bool
Public Function TryTake (ByRef item As T) As Boolean

參數

item
T

如果這個方法會傳回且物件已成功移除和傳回,則 item 會包含移除的物件。 如果沒有可移除的物件,值會是 unspecified。

傳回

如果成功移除及傳回物件,則為 true;否則為 false

適用於

另請參閱