IStack<T>.TryPeek Method

Definition

Attempts to return an element from the top of the stack without removing it.

Delphi
function TryPeek(var item: T): Boolean

Parameters

item
T

The element at the top of the stack if the operation was successful; Default(T) otherwise.

Returns

Boolean

True if an element was returned; otherwise, False .