Answer the question
In order to leave comments, you need to log in
How to use iterators correctly? Is it possible to create 2 iterators per 1 container?
For example, there is a vector vector vec; with data. It is supposed to make dwarf sorting and therefore in the algorithm it is necessary to access the current element and the previous one at the same time when comparing. What is better to use: iterators or to have access to a vector element through an index, like an array (a[i - 1] < a[i]). I mean is it possible to have multiple iterators per container. In principle, I can organize all the additional checks when working with iterators. Or in this case indexes are better?
(The site has a bad captcha, it is difficult to understand clumsy letters, large or small)
Answer the question
In order to leave comments, you need to log in
I mean is it possible to have multiple iterators per container.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question