Removing keys while iterating is not supported. It will break, in confusing ways, and possibly include a null pointer dereference.
IRC, the specs says that it's an error to modify a foreach aggregate but the compiler curretly doesn't diagnose it.
Per Nordlöw via Digitalmars-d-learn Tue, 13 Dec 2022 03:26:06 -0800
Removing keys while iterating is not supported. It will break, in confusing ways, and possibly include a null pointer dereference.
IRC, the specs says that it's an error to modify a foreach aggregate but the compiler curretly doesn't diagnose it.