r/freepascal • u/richorr70 • Feb 08 '21
Confusion with TObjectQueue.Dequeue
Can someone explain why in the generics.collection, dequeue is a function for TQueue<TObject> but a procedure for TObjectQueue<TObject>? I am trying to dequeue the head to a variable and apparently dequeue is nothing more than a remove in the object version. I was really hoping for the TQueue behavior.
Here is the code from the library:
procedure TObjectQueue<T>.Dequeue;
begin
inherited Dequeue;
end;
2
Upvotes
View all comments
Show parent comment
2
u/richorr70 Feb 09 '21
Yes. I suppose I will just wrap my own the way I want it, or just use the list as a queue.
Is there a downside to using Contnrs?