Is remove safe using foreach

Per Nordlöw per.nordlow at gmail.com
Tue Dec 13 11:22:35 UTC 2022


On Monday, 12 December 2022 at 17:29:00 UTC, Steven Schveighoffer 
wrote:
> 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.


More information about the Digitalmars-d-learn mailing list