remove method Null safety

bool remove(
  1. E element
)

Removes an element of the queue that compares equal to element.

Returns true if an element is found and removed, and false if no equal element is found.

If the queue contains more than one object equal to element, only one of them is removed.

Uses the Object.== of elements in the queue to check for whether they are equal to element. Equal objects objects must have the same priority according to the comparison function. That is, if a == b then comparison(a, b) == 0. If that is not the case, this check might fail to find an object.

Implementation

bool remove(E element);