Re: Traverse a DList and insert / remove in place?

2023-03-27 Thread Armando via Digitalmars-d-learn
Wonderful, that works like a treat, thank you so much! For those who wonder, inserting after works too: ```d for (auto range = list[]; !range.empty;) { if (range.back.id == 8) list.insertAfter(range, MyType(88)); range.popBack(); } ``` which will give ```

Re: Traverse a DList and insert / remove in place?

2023-03-19 Thread Armando via Digitalmars-d-learn
ok there is the issue of not knowing how to traverse the list after removing the current element (=> the one that came after of course). But how about even just keeping a pointer (range) to 'element' that can be used after the list has been traversed in full to use in remove / insertAfter? I

Traverse a DList and insert / remove in place?

2023-03-19 Thread Armando via Digitalmars-d-learn
Say I have a DList. I am looking for a vanilla way to insert/remove elements in place while traversing that list. ```d import std.container : DList; struct myType{ int id; // [...] other stuff } auto list = DList!myType(); // [...] populate list with elements ``` To remove the element

Re: vibe.d problem

2014-11-18 Thread Lázaro Armando via Digitalmars-d-learn
Thread name: Re: vibe.d problem Mail number: 2 Date: Tue, Nov 18, 2014 In reply to: DigitalmarsD learn On Mon, 17 Nov 2014 16:24:17 -0500 låzaro via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Building vibe-d 0.7.20 configuration libevent, build type debug. this is