Re: Is there a queue class in phobos?

2010-08-10 Thread Trass3r
Wouldn't a regular array with a couple of free functions work? You will get a lot of reallocations. For non-trivial applications you need some more sophisticated approach to alter the size of the array and maybe also deterministic memory management. A queue is a commonly used technique so

Re: Is there a queue class in phobos?

2010-08-10 Thread Jonathan M Davis
On Tuesday, August 10, 2010 12:06:55 Mafi wrote: > Am 10.08.2010 18:22, schrieb Trass3r: > > Container has List, BinaryHeap etc. but no Queue. Is there anything like > > that in Phobos? > > Hi, > I don't know if ther is one but I think D's arrays are powerful enough > unless you avoid the GC. > >

Re: Is there a queue class in phobos?

2010-08-10 Thread Mafi
Am 10.08.2010 18:22, schrieb Trass3r: Container has List, BinaryHeap etc. but no Queue. Is there anything like that in Phobos? Hi, I don't know if ther is one but I think D's arrays are powerful enough unless you avoid the GC. 1. a.front() => a[0] 2. a.popFront() => a = a[1..$] 3. a.pushBack(

Re: Is there a queue class in phobos?

2010-08-10 Thread Jacob Carlborg
On 2010-08-10 18:22, Trass3r wrote: Container has List, BinaryHeap etc. but no Queue. Is there anything like that in Phobos? Wouldn't a regular array with a couple of free functions work? -- /Jacob Carlborg

Re: Is there a queue class in phobos?

2010-08-10 Thread Jonathan M Davis
On Tuesday, August 10, 2010 09:22:16 Trass3r wrote: > Container has List, BinaryHeap etc. but no Queue. Is there anything like > that in Phobos? At the moment, I believe that what you see is what you get. std.container is quite young, and there are definitely going to be more containers in it, bu

Is there a queue class in phobos?

2010-08-10 Thread Trass3r
Container has List, BinaryHeap etc. but no Queue. Is there anything like that in Phobos?