System.Generics.Collections.TStack.Peek
Delphi
function Peek: T; inline;
C++
T __fastcall Peek();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Generics.Collections.pas System.Generics.Collections.hpp |
System.Generics.Collections | TStack |
Description
Look at top stack item.
Peek returns the item from the top of the stack without removing it. If Count is 0, an error is raised. Count is unchanged.
Pop functions similarly to Peek except that Pop removes an element from the stack.
This is a O(1) operation.
See Also
Code Examples