www.digitalmars.com         C & C++   DMDScript  

D - BUG bool inout

those:

bool keys[SDLK_LAST];

for(uint index = 0;index < keys.length; ++index) {
keys[index] = keyStates[index] == 0 ? false : true;
}

foreach(uint index, inout bool key; keys) {
key = keyStates[index] == 0 ? false : true;
}

should be equivalent..

they aren't. foreach doesn't write to key.
Nov 11 2003