System.Generics.Collections.TQueue.Dequeue

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Dequeue: T; inline;

C++

T __fastcall Dequeue();

Properties

Type Visibility Source Unit Parent
function public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TQueue

Description

Removes the item from the beginning of the queue.

Dequeue removes and returns the beginning element of the queue. Count is decremented by 1. If Count is already 0, an error is raised.

An OnNotify event occurs indicating an item was removed from the queue. Dequeue is the same as Extract except for the event code indicating an element was removed rather than extracted.

Dequeue functions similarly to Peek except that Dequeue removes an element from the queue.

Dequeue is the same as Extract except for the event code indicating an element was removed rather than extracted. Extract is a more generic method, common to all collections, whereas Dequeue is specialized for TQueue. You can use either of the two functions to obtain and remove the item at the beginning of the queue.

This is a O(1) operation.

See Also

Code Examples