5 ms·
Ugh, define need. If sanity is required, stick to iterators.
by alexchamberlain 13y ago
Ugh, define need. If sanity is required, stick to iterators.
- mrich 13y agoIterators can get very ugly. I like this when there is a need to access elem a lot inside the loop: for (size_t i = 0, iEnd = elems.size(); i < iEnd; ++i) { Elem &elem = elems[i]; // deal with elem } Of course the new C++11 syntax is king.