Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-12-14 00:56:14


Hi Gennadiy,

On 12/14/01 12:46 AM, "rogeeff" <rogeeff_at_[hidden]> wrote:

> Hi,
>
> I have a question about iterator_adaptor. The iterator_adaptor seems
> to assume that Policies are stateless. For example, it never copy
> them in copy constructor and iterator. Why it was designed that way?

Sure it does. The m_iter_p member gets copied, and the policies object
Is inside m_iter_p, so it gets copied.

> Another related questions:
> Why does not iterator_adapter has a copy_constructor/assignment
> accepting Base iterator?

There is a constructor that accepts the Base iterator, though of course it
is not technically a copy constructor.

As for the assignment operator... I guess we didn't see a real need for it.
Do you see a real need for it?

> Why does not iterator_adapter has a constructor accepting some
> argument to be passed to policy constructor?

This was considered, but we felt that would complicate things. And you can
just create a make_xxx_iterator function that hides the complication of
creating the policy object explicitly.

>
> If there are reasons for such design, how to implement what I need?

What do you need?

>
> Another separate issue:
> If my Base input iterator returns reference as result of operator*,
> how to prevent iterator_adaptor::operator-> to create a proxy?

That's a tough one... Dave?

Cheers,
Jeremy

-- 
Jeremy Siek                          http://www.osl.iu.edu/~jsiek
Ph.D. Student, Indiana Univ. B'ton   email: jsiek_at_[hidden]
C++ Booster (http://www.boost.org)   office phone: (812) 855-3608

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