Steven Schveighoffer Wrote: > ahem, using dcollections: > > foreach(ref doRemove, cell; &organism.purge) > doRemove = cell.x == x && cell.y == y; > > complexity: O(n)
may be a generic iteration handler would be more useful? foreach(ref handler, cell; &organism.each) if(cell.x == x && cell.y == y) handler.removeCurrent(); it could provide a whole api, say, you may want to have lookahead foreach(ref handler, cell; &organism.each) if(cell.x == x && cell.y == y && handler.next.x==0) handler.removeCurrent();