August 31, 2020 The best way to remove an element from DList while iterating over the elements | ||||
---|---|---|---|---|
| ||||
Hello! I've been trying to implement something like that: struct Element { bool isPendingRelease; } DList!Element elements; void FreePendingElements() { foreach(ref elem; elements) { if (elem.isPendingRelease) { // remove it here from elements } } } What's the best way to implement the logic I want? Thanks, Ivan |
Copyright © 1999-2021 by the D Language Foundation