Sorry, I meant to say, a dynamic array of pointers to
fixed-sized arrays.
That's for a stack. For a queue a nice implementation is a
power-of-2 growable circular queue of pointers to fixed-sized
arrays (chunks); plus a ("intrusive", no more memory needed)
linked list of some of the last free
On 2013-01-13 20:55, Damian wrote:
As per title, it would be awesome if someone could link me to these. I'm
quite suprised that D does not already contain these.. are there any
plans for them joining Phobos?
Tango has a stack, at least:
https://github.com/SiegeLord/Tango-D2
http://www.dsource.
Andrey:
D's containers are disappointment.
They will get better because I think D is slowly getting all the
machinery to implement them well, finishing the implementation of
const/immutable, shared and memory allocators.
Bye,
bearophile
ponce:
I wrote a Queue/RingBuffer here:
https://github.com/p0nce/gfm/blob/master/common/queue.d
You have code like:
return _data[(_first + _count - 1) % _data.length];
Take a look here:
http://rosettacode.org/wiki/Queue/Usage#Faster_Version
It keeps another instance field:
private uint pow
D's containers are disappointment. I'm currently writing custom
module of data structures to be as fast, economic and close to
hardware as possible. I'm almost at the beginning stage, so no
clear timeline.
Thanks creators, D allows to work with low level stuff and mix it
rather effectively wi
On Sunday, 13 January 2013 at 19:55:28 UTC, Damian wrote:
As per title, it would be awesome if someone could link me to
these. I'm quite suprised that D does not already contain
these.. are there any plans for them joining Phobos?
I wrote a Queue/RingBuffer here:
https://github.com/p0nce/gfm/b
On Sun, Jan 13, 2013 at 09:02:38PM +0100, Peter Alexander wrote:
> On Sunday, 13 January 2013 at 19:55:28 UTC, Damian wrote:
> >As per title, it would be awesome if someone could link me to
> >these. I'm quite suprised that D does not already contain these..
> >are there any plans for them joining
The standard container you refer to is deque, sometimes
implemented as a dynamic array of fixed-sized arrays,
Sorry, I meant to say, a dynamic array of pointers to fixed-sized
arrays.
Bye,
bearophile
Peter Alexander:
Well, a stack is just an array.
int[] stack;
stack ~= 1;
stack ~= 2;
assert(stack.back == 2);
stack.popBack();
assert(stack.back == 1);
stack.popBack();
assert(stack.empty);
If you want strict stack semantics (i.e. *only* allow access to
the top/back) then you could trivially
On Sunday, 13 January 2013 at 19:55:28 UTC, Damian wrote:
As per title, it would be awesome if someone could link me to
these. I'm quite suprised that D does not already contain
these.. are there any plans for them joining Phobos?
Here's one I am using: https://gist.github.com/4525926
You can
Damian:
As per title, it would be awesome if someone could link me to
these. I'm quite suprised that D does not already contain
these.. are there any plans for them joining Phobos?
Currently Phobos doesn't have deque, queue and stack data
structures. I hope it will eventually have them. In t
On Sunday, 13 January 2013 at 19:55:28 UTC, Damian wrote:
As per title, it would be awesome if someone could link me to
these. I'm quite suprised that D does not already contain
these.. are there any plans for them joining Phobos?
Well, a stack is just an array.
int[] stack;
stack ~= 1;
stack
As per title, it would be awesome if someone could link me to
these. I'm quite suprised that D does not already contain these..
are there any plans for them joining Phobos?
13 matches
Mail list logo