3 ms·
We use our own game engines which still use lots of custom containers which won't necessarily work with a for each loop. In the best case you will get a cryptic
by gambiting 5y ago
We use our own game engines which still use lots of custom containers which won't necessarily work with a for each loop. In the best case you will get a cryptic error message, worst case it will look like it's working but actually be very inefficient or crash(that's what happens when games programmers start overriding Count to mean something else depending on the usage basically). It's a self inflicted wound basically.
- CodesInChaos 5y agoDoesn't foreach expand to the same `for(it = collection.begin(); it != collection.end(); ++it)` loop you'd otherwise write manually? Or are iterator based loops also avoided in that codebase?