for(auto& entity : memoryManager.getItems()) entity->update(mFrameTime);
If memoryManager contains 1000 elements, does memoryManager.getItems() call 1000 times or only one at the start of the loop?
Does the compiler perform optimizations with -O2 (or -O3)?
( memoryManager.getItems() returns a std::vector<Entity*>& )
c ++ performance foreach for-loop c ++ 11
Vittorio Romeo Apr 02 '13 at 13:56
source share