Boost logo

Boost :

From: Roland Richter (roland_at_[hidden])
Date: 2004-04-14 16:22:53


Neal D. Becker wrote:

> Still I'm very interested in your approach, but I have some questions.
>
> 1) The constructors I used take 3 arguments, the begin, end, and current
> position. I don't see how this would work with only 2 arguments. If I do:
>
> make_iterator (v.begin()+2, v.end())
>

  Write

    make_cyclic_iterator( v.begin(), v.end() ) + 2

  instead. I decided that make_cyclic_iterator() constructs an iterator
  pointing to the beginning. Ok, not elegant, I might reconsider it.

>
> 2) If I have a Ring class, it needs a copy constructor. This copies the
> underlying container, then needs to setup a new iterator. It is desirable
> to be able to:
> a) get the state of the old iterator
> b) construct a new iterator with this state
>
> If you look at my Ring and iterator, you see that iterator has a function
> "offset" that basically retrieves the original state information, and the 3
> arg constructor allows setting the state. Do you think something similar
> is needed for you implementation?
>

  Yep, a copy ctor or somehing is also missing. As soon as I find the time ...

- Roland


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