Boost logo

Boost Users :

From: Jens Theisen (jens.theisen_at_[hidden])
Date: 2005-03-21 14:24:04


David Abrahams wrote:
>>That is, writing
>>
>>*iter++ = some_value;
>>
>>doesn't really do anything but changing a temporary value in the
>>proxy.
>
>
> If that's the case, the iterator_facade is choosing
> postfix_increment_proxy instead of writable_postfix_increment_proxy,
> on the basis of the fact that you haven't given the iterator a proxy
> reference type. I'm not sure I understand the logic behind it, but
> iterator_facade assumes that if your readable iterator doesn't support
> forward traversal, it must have a proxy reference in order to also be
> writable. If you have a counterexample, it would be good to see it.

My reference type is a simple reference, I want to implement an lvalue
iterator (at least in some cases).

I am trying to make a proxy iterator that can be attached to different
implementations of other iterators and compositions thereof.

The problem with Forward traversal is that I can't really compare to
iterators at the moment. My equals is defined as true iff both sides are
empty (past the end of the sequence). :-)

I thought changing this would require passing the comparison
functionality through to the implementations, what I don't really want
to do; in part because the implementations can be quite nested, so this
would be a bit slow for something that I need solely as an
end-of-sequence test.

To be honest, I don't consider this a real problem anymore. I could
simply attach a counter to the iterators to do the actual comparison.
So, Forward traversal it is.

Thank you for your assistance.

Best regards, Jens


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net