for(auto& entity : memoryManager.getItems()) entity->update(mFrameTime);
If memoryManager contains 1000 items, does memoryManager.getI
It is only evaluated once. The standard defines a range-based for
statement as equivalent to:
{
auto && __range = range-init;
for ( auto __begin = begin-expr, __end = end-expr; __begin != __end; ++__begin ) {
for-range-declaration = *__begin;
statement
}
}
where range-init
is the expression (surrounded by parentheses) or braced-init-list after the :