Boost logo

Boost :

From: yahoo_at_[hidden]
Date: 2001-02-28 03:44:39


--- In boost_at_y..., "md656" <md656_at_q...> wrote:
> > I would like to iterate over a container again and again (a
vector,
> > list or set). I would like to simply increment the iterator all
the
> > time, without having to check if I reached the end().
>
>
> Sounds like a pretty straightforward program to me. Why not just do
it?
>
> template<class Iter> class Cyclic_iterator {
> public:

> // and so on -- it's up to you to fill in the rest
>
> private:
> Iter begin, end, it;
> };
>

The devil is in the "so on", that's why you REALLY want to use
Boost Iterator Adaptor Library, trust me .

Cheers
Bernard


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