Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-07 15:10:56

FWIW, you only need to supply the Value type; the rest can be deduced.
The claim in the docs is correct. Nobody promised the defaults would work
for all Base types; that's why they're only defaults, and not hardcoded.

           David Abrahams * Boost Consulting
dave_at_[hidden] *

----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 07, 2002 2:42 PM
Subject: Re: [boost] iterator_adaptors and shared_ptr

> 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.
> Cheers,
> Jeremy
> On Wed, 7 Aug 2002, George A. Heintzelman wrote:
> george>
> george> There's a claim in the iterator_adaptor documentation
> george> ( that
> 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>
> george> Has anyone actually ever used an indirect_iterator for this? I am
> george> a somewhat old version of boost, so it may be me, but I looked at
> george> new code and I can't see differences that fix my problem, which
> george>
> george> std::iterator_traits< boost::shared_ptr<T> > isn't defined, so
> george> indirect_iterator doesn't have a value_type it can latch onto.
> george>
> george> Well, it's not hard to fix up a template that does this, if you
> george> partial specialization, so I did that, but it doesn't seem like
> george> right solution since a shared_ptr isn't really an iterator, it's
> 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
> george>
> george> George Heintzelman
> ----------------------------------------------------------------------
> Jeremy Siek
> Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
> C++ Booster ( office phone: (812) 855-3608
> ----------------------------------------------------------------------
> _______________________________________________
> Unsubscribe & other changes:

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