Redigera

Dela via


PriorityQueue<TElement,TPriority>.TryDequeue Method

Definition

Removes the minimal element from the PriorityQueue<TElement,TPriority>, and copies it and its associated priority to the element and priority arguments.

public:
 bool TryDequeue([Runtime::InteropServices::Out] TElement % element, [Runtime::InteropServices::Out] TPriority % priority);
public bool TryDequeue (out TElement element, out TPriority priority);
member this.TryDequeue : 'Element * 'Priority -> bool
Public Function TryDequeue (ByRef element As TElement, ByRef priority As TPriority) As Boolean

Parameters

element
TElement

When this method returns, contains the removed element.

priority
TPriority

When this method returns, contains the priority associated with the removed element.

Returns

true if the element is successfully removed; false if the PriorityQueue<TElement,TPriority> is empty.

Applies to