Rediger

Del via


Stack<T>.TryPop(T) Method

Definition

Returns a value that indicates whether there is an object at the top of the Stack<T>, and if one is present, copies it to the result parameter, and removes it from the Stack<T>.

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

Parameters

result
T

If present, the object at the top of the Stack<T>; otherwise, the default value of T.

Returns

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

Applies to