On Tuesday, October 8, 2019 2:42:22 PM MDT mipri via Digitalmars-d-learn
wrote:
> On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis
>
> wrote:
> > The result of this is that code like
> >
> > stack.popBack();
> > stack ~= foo;
> > stack ~= bar;
> > stack.popBack();
> > stack ~= baz;
> >
On Tue, Oct 08, 2019 at 08:42:22PM +, mipri via Digitalmars-d-learn wrote:
> On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis wrote:
> > The result of this is that code like
> >
> > stack.popBack();
> > stack ~= foo;
> > stack ~= bar;
> > stack.popBack();
> > stack ~= baz;
> >
> >
On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis
wrote:
The result of this is that code like
stack.popBack();
stack ~= foo;
stack ~= bar;
stack.popBack();
stack ~= baz;
will end up allocating all over the place. Every time you
append to the array after shrinking it, you're going to
Thanks for the advice. I used a quick and dirty range solution as
was suggested. It allowed me to move on as I really wasn't
looking to fully implement a queue or stack. Just get something
that semantically behaved as such. I'll return later and optimize
it with the later suggestions if it's a
On Monday, October 7, 2019 1:16:31 PM MDT IGotD- via Digitalmars-d-learn
wrote:
> On Monday, 7 October 2019 at 17:36:09 UTC, Ferhat Kurtulmuş wrote:
> >> I'm not talking about memory deletion. I'm talking about push,
> >> pop, enqueue, and dequeue behavior. I'd assume in a garbage
> >> collected l
On 10/07/2019 10:11 AM, Just Dave wrote:
I need a stack and a queue
There is a DoubleEndedQueue example under "Indexing Operators" here:
http://ddili.org/ders/d.en/operator_overloading.html#ix_operator_overloading.opIndexOpAssign
It does not have the pop varieties but it should be trivial to
On Monday, 7 October 2019 at 19:38:50 UTC, mipri wrote:
On Monday, 7 October 2019 at 19:16:31 UTC, IGotD- wrote:
On Monday, 7 October 2019 at 17:36:09 UTC, Ferhat Kurtulmuş
wrote:
I'm not talking about memory deletion. I'm talking about
push, pop, enqueue, and dequeue behavior. I'd assume in
On Monday, 7 October 2019 at 19:16:31 UTC, IGotD- wrote:
On Monday, 7 October 2019 at 17:36:09 UTC, Ferhat Kurtulmuş
wrote:
I'm not talking about memory deletion. I'm talking about
push, pop, enqueue, and dequeue behavior. I'd assume in a
garbage collected language letting the reference float
On Monday, 7 October 2019 at 17:36:09 UTC, Ferhat Kurtulmuş wrote:
I'm not talking about memory deletion. I'm talking about push,
pop, enqueue, and dequeue behavior. I'd assume in a garbage
collected language letting the reference float off should be
picked up by the GC.
I'm sorry. Writing on
On Monday, 7 October 2019 at 17:28:11 UTC, Just Dave wrote:
On Monday, 7 October 2019 at 17:24:19 UTC, Ferhat Kurtulmuş
wrote:
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
[...]
Built-in D arrays rely on garbage collector, and you don't
need an explicit delete. For nogc arrays
On Monday, 7 October 2019 at 17:24:19 UTC, Ferhat Kurtulmuş wrote:
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack a
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack and queue, which
I think the dynamic array should be able to do (if
On Monday, 7 October 2019 at 17:18:03 UTC, bachmeier wrote:
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack and queu
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack and queue, which
I think the dynamic array should be able to do (if
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack and queue, which
I think the dynamic array should be able to do (if
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote:
I need a stack and a queue and I noticed that the standard
library doesn't appear to have one. Which is ok. I just need
something that can logically behave as a stack and queue, which
I think the dynamic array should be able to do (if
16 matches
Mail list logo