Removing an element from a DList

Joakim G. joagre at gmail.com
Tue Oct 17 17:27:19 UTC 2023


For some reason I cannot remove an element from a DList. I tried 
several range approaches but to no avail. I'm a noob.

In the end I did this:

```
private void removeFromWaitingQueue(uint jid) {
     auto arr = waitingQueue[].array;
     arr = arr.remove!(job => job.jid == jid);
     waitingQueue.clear();
     foreach(job; arr) {
         waitingQueue.insertBack(job);
     }
}
```

Any hints?

/J



More information about the Digitalmars-d-learn mailing list