Boost logo

Boost :

From: Bill Wade (bill.wade_at_[hidden])
Date: 2002-03-20 08:51:49


This is undefined even for random access iterators when x.base() is past the
end of the container.
Think about how a deque iterator will behave if you increment it well beyond
the end of the deque.

> >>>>> "Gennadiy" == Gennadiy Rozental <rogeeff_at_[hidden]> writes:
>
> Thanks for the pointer. Interesting. I think what the joining
> iterator is doing is depending on a state variable to switch between 2
> iterator ranges?
>
> Not quite what I was looking for. I'm thinking something like this:
> This will switch automatically. Probably only works for random_access.
>
> if (x.base() - b1 >= e1 - b1)
> return *(b2 + (x.base() - e1));
> else
> return *(x.base());


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk