[fpc-pascal] Queue integer values
leledumbo_cool at yahoo.co.id
Thu Dec 17 09:31:12 CET 2009
> I need a queue that can store integer values. Is there any way to use
TQueue for this task
You can extend TQueue to have a method to insert the integer as pointers.
TMyQueue = class(TQueue)
procedure AddInt(const Integer: i);
... // implementation
procedure TMyQueue.AddInt(const Integer: i);
Just don't forget to Dispose all the contents before destroying the queue or
you'll have memory leak.
> or does a generic queue class exist which I can use?
AFAIR, no. Last time I check, only list and map have been implemented. But
you can make your own, it's not difficult.
View this message in context: http://old.nabble.com/Queue-integer-values-tp26817366p26824766.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
More information about the fpc-pascal