System.Generics.Collections.TQueue.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 | TQueue |
Description
Get top item on queue.
Peek returns the top item of the queue without removing it. Count is unchanged. No event is generated. If Count is 0, an error is raised.
Peek functions similarly to Dequeue except that Dequeue removes the top item.
This is a O(1) operation.
See Also
Code Examples