Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-15 06:44:55


From: "Thomas Witt" <witt_at_[hidden]>

>

> With iterator_adaptor only a ctor taken the base_type is provided. As I
tried
> to show in my code example there is a way to use iterator_adaptor and
have
> the desired ctor, but I consider this solution a hack. In order to have
the
> desired ctor(directory_iterator(path const&)) I have made path the base
type.
> All iterator state is moved in the policies object and the base_type
object is
> only used during initialization. After the initialization the base_type
object
> is just unneccessary ballast.

Why not just store it in the policies object to begin with, and provide an
object factory (which takes a path) as many of the examples do?

    make_directory_iterator(char const* path)
    {
        dir_it(some_base_object(), dir_it_policies(path));
    }

> >
> > If so, I think it'll have to wait for our new iterator_adaptor design
(I
> > hope sometime early November).
>
> I wasn't trying to say come on guys fix iterator_adaptors. I just think
this
> is a new use-case that makes making iterator_adaptor derivable a worthy
goal.
> I would be very interested in discussing ideas regarding
iterator_adaptor.

Jeremy and I (and maybe Steve Cleary) were planning to work on it in off
hours at Santa Cruz. Will you be there?

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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