Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-08-07 13:42:03

Hi George,

Are you supplying types for the Value, Reference, etc. parameters of
indirect_iterator_generator, or are you relying on the defaults? I think
the problem is that you are relying on the defaults, which is to look at
std::iterator_traits. If instead you supply the Value type, etc. I think
things should work.


On Wed, 7 Aug 2002, George A. Heintzelman wrote:
george> There's a claim in the iterator_adaptor documentation
george> ( that "For
george> example, [indirect_iterator] makes it possible to view a container of
george> pointers or smart-pointers (e.g. std::list<boost::shared_ptr<foo> >)
george> as if it were a container of the pointed-to type."
george> Has anyone actually ever used an indirect_iterator for this? I am using
george> a somewhat old version of boost, so it may be me, but I looked at the
george> new code and I can't see differences that fix my problem, which is:
george> std::iterator_traits< boost::shared_ptr<T> > isn't defined, so the
george> indirect_iterator doesn't have a value_type it can latch onto.
george> Well, it's not hard to fix up a template that does this, if you have
george> partial specialization, so I did that, but it doesn't seem like the
george> right solution since a shared_ptr isn't really an iterator, it's just
george> dereferenceable. Is there a fix (that I'm missing in my inspection of
george> the new code) or is this something that ought to be thought about?
george> George Heintzelman

 Jeremy Siek
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster ( office phone: (812) 855-3608

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