A
Alf P. Steinbach /Usenet
I started out searching for complexity requirements for std::deque:perator[].
But then I ended up doing the same for std::vector:perator[].
It seems to reduce to *(begin() + i), where begin() is guaranteed constant time,
but regarding the '+ i', for random access iterators that's defined by a loop,
with no complexity requirement that I can see.
Loopety-loop-loop, loop loop.
So, is there any complexity requirement at all (better than linear)?
Perhaps I'm blind on both eyes again, it has happened before...
Cheers,
- Alf
But then I ended up doing the same for std::vector:perator[].
It seems to reduce to *(begin() + i), where begin() is guaranteed constant time,
but regarding the '+ i', for random access iterators that's defined by a loop,
with no complexity requirement that I can see.
Loopety-loop-loop, loop loop.
So, is there any complexity requirement at all (better than linear)?
Perhaps I'm blind on both eyes again, it has happened before...
Cheers,
- Alf