|
Boost : |
From: Rozental, Gennadiy (gennadiy.rozental_at_[hidden])
Date: 2003-08-06 15:42:34
> |>| What is the problem adapting pair of iterators to scalar
> vectors to
> |>produce
> |>| an iterator with complex value type?
> |>
> |>The problem is you can hardly adapt a pair. So using
> iterator_adaptor
> |>(the new class template) does not provide any benefit.
> |
> |
> | Why is that?
>
> The whole point in adapting is that you modify some but not
> all behavior/interface of a thing. There is nothing a pair
> provides that can be reused so adoption is pointless.
There is all that we need so we could create valid iterator. As for how much
we will need to overwrite - it still less then writing iterator from
scratch.
> That's why the new version provides iterator_facade and
> iterator_adaptor. iterator_facade helps with implementing
> iterators, iterator_adaptor is for adapting iterator like types.
>
> | I did not look in depth on new version but I remember that old one
> | allowed to adapt any source.
>
> You needed to do this as the iterator interface
> implementation was not separated from the actual iterator_adaption.
I do not argue which version better fit for the task. I just saying that it
could be easily done with old version either.
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk