https://issues.dlang.org/show_bug.cgi?id=13410
--- Comment #24 from Martin Nowak <c...@dawg.eu> --- In other words, this optimizes the following code foreach (_; 0 .. 1_000_000) aa.byKey(); but pessimizes the following aa.remove(key); It does NOT improve iterating byKey. So unless there is a valid use case to call aa.byKey.front in a loop this would only improve a pointless microbenchmark. Batch deletion is much better done with a dedicated remove function. aa.remove((k, v) => pred(k)); Any volunteers for implementing the latter? --