passes through the return type of dg.
Consider a map that stores char[5] values with hash_t keys.
foreach (ref key, val; map) { // typeof(key) is hash_t. A pointer to the key can be obtained // using &key. // typeof(val) is char[], val is a dynamic array slice // referencing the value in the map. A pointer to the value can // be obtained using val.ptr. }
Invokes dg with the key and, unless V is 'void', the value of element.
Do not modify the key in-place.
If K or V (or both) are a static array, a dynamic array slice is passed to dg. Do not do a 'ref' iteration over static array keys or values. To obtain a pointer to the static array key or value currently iterating over, use the .ptr of the iteration variable.