Quick Q: Why might a C++11 range-for loop appear slow? -- StackOverflow

Quick, can you spot the problem in this line of code?

for(vector<int> vec1 : backgroundData)

Probably you can -- but what's the best solution?

Read on here, yesterday on StackOverflow:

C++11: Why does this range loop decrease FPS by 35?

[...] Is the C++11 range-based loop so much slower than the old school for? I really want to hear an answer to this, because my eyes honestly prefer the range based loop, and I'd hate to find out that the range based loop is twice as slow.

 

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.