Boost logo

Boost :

From: Yitzhak Sapir (yitzhaks_at_[hidden])
Date: 2002-06-13 08:04:54


Why is it necessary that v.begin() return something addressable for the iterator to count as forward iterator? If I implement a "forward" iterator whose iterator_traits::value_type is a proxy (as opposed to an iterator that returns a proxy to it's value_type) why wouldn't it be a forward iterator?

I ask this because I'd obviously like to learn, and I had thought that while proxies are problematic in a forward iterator, if the iterator was an iterator to the proxy class it was ok (and my thinking may have been wrong on the issue).

> -----Original Message-----
> From: Jeremy Siek [mailto:jsiek_at_[hidden]]
> Sent: Tuesday, June 11, 2002 6:52 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Dynamic Bitset Formal Review June 8-17
>
>
> On Mon, 10 Jun 2002, Chuck Allison wrote:
> cda>
> cda> But isn't it still an issue that you can't fulfill all of the
> cda> iterator requirements because a bit is not addressable? In other
> cda> words, iterators must allow:
> cda>
> cda> T* p = &*v.begin();
>
> Yes, that is an issue. Thus a bit iterator can't model the Forward
> Iterator concept.
>
> cda> Can we do this with dyn_bitset?
>
> I don't know of a way.
>
> With my new iterator categories, the bit iterator could be better
> categorized as a read and write iterator (but not lvalue) and it would
> have random access traversal.
>
> Cheers,
> Jeremy
>
>
> ----------------------------------------------------------------------
> Jeremy Siek http://php.indiana.edu/~jsiek/
> Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
> C++ Booster (http://www.boost.org) office phone: (812) 855-3608
> ----------------------------------------------------------------------
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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