Boost logo

Boost :

From: Bernard HUGUENEY (bernard.hugueney_at_[hidden])
Date: 2000-10-25 06:20:39

I'm greatly interested by iterator_adaptor, and currently (ab)using it a lot.
It really made me rewrite as much of my own stuff as time permitted to make my iterators "right".
I'm currently experiencing troubles when composing some iterators:
 when I retrun a dereference() value, it is by reference, but if the underlying iterator (as one from counting_iterator_policies) returns by value, the compiler complains that I take the reference to the temporary underlying return value :-(

Would it be possible to fix integer_range ? Or what would be the correct workaround ? It might be that counting_iterator_policies is correct :-( I guess that means I should specialize my iterator wrappers to hold a copy
of the dereferenced iterator is it's iterator_traits<>::reference is not one, but I'd rather not...

A problem, I believe, lie in the fact that the refreturned is not const, and dereference() takes a const iterator. I did not
find any satisfying solution (my code uses const_cast<>), but I'no guru myself :-)

Anyway, thank you for the great work, I'm always more than happy to rewrite code when it involves using some
"treasures from the vault" :-)


European Union wants to know what people think of software patents !

Boost list run by bdawes at, gregod at, cpdaniel at, john at