แก้ไข

แชร์ผ่าน


Queue<T>.TryPeek(T) Method

Definition

Returns a value that indicates whether there is an object at the beginning of the Queue<T>, and if one is present, copies it to the result parameter. The object is not removed from the Queue<T>.

public:
 bool TryPeek([Runtime::InteropServices::Out] T % result);
public bool TryPeek (out T result);
member this.TryPeek : 'T -> bool
Public Function TryPeek (ByRef result As T) As Boolean

Parameters

result
T

If present, the object at the beginning of the Queue<T>; otherwise, the default value of T.

Returns

true if there is an object at the beginning of the Queue<T>; false if the Queue<T> is empty.

Applies to