Boost logo

Boost Users :

From: Jan Langer (yg-boost-users_at_[hidden])
Date: 2002-06-10 14:35:14


hello,
i do use iterator adaptor to build a bit_iterator, which return single
bits of the elements of an underlying iterator. the base_type of my
iterator_adaptor is std::pair <BaseIterator, unsigned int> representing
the iterator and the bit position.
now my iterator does not work if i adapt istreambuf_iterator because
  self operator++(int) { self tmp(*this); ++*this; return tmp; }
of iterator_adaptor is not able to use the proxy returned by the postfix
increment of the input iterator.

now i searched the archive and found in:
    Subject: Re: [boost] (infinite) sequences using recurrence relations
    From: Corwin Joy < cjoy_at_xxxx >
    Date: Fri, 10 Aug 2001 01:21:28 -0500

the following sentence:
>In table 72, p. 511 of the standard you will notice something weird about
>the postfix increment operator:
>Namely, it is specified as (void)r++.
>In other words, unlike all other standard iterator types, an input iterator
>is not required to return a copy of its old value!

but this would mean that the expression *i++ is wrong in most cases.
is there a trick to make iterator_adaptor also handle this case or shall
i hope that nobody types *i++ with my bit_iterator based on such an
input iterator, or did i understand something incorrectly?
regards

-- 
jan langer ... jan_at_[hidden]
"pi ist genau drei"

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