Are there upper bounds on the time it can take to increment/decrement an iterator of a standard library collection (e.g. std::map)? (Assuming the container itself is not changed.)
Are there upper bounds on the time it can take to increment/decrement an iterator
Share
No, there is no upper bound on the time it can take to increment/decrement an iterator. The standard is silent on how long any program takes to run. As far as I know, all of the popular compilers are also silent on the subject.
Having said that, however, the typical implementations do nothing that would take significant time. There are no memory allocations or file-IO (other than VM page-ins, I suppose.)