Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-31 07:38:17


From: "David Abrahams" <yg-boost-users_at_[hidden]>
> "Peter Dimov" <pdimov_at_[hidden]> wrote in message
> news:00ce01c24f65$03862790$1d00a8c0_at_pdimov2...
> >
> > I have since added ::value_type to shared_ptr, but unfortunately, this
is
> > apparently not enough. Even though the indirect iterator adaptor needs
> only
> > the value_type, the attempt to instantiate std::iterator_traits means
that
> > make_indirect_iterator cannot work with shared_ptr.
>
> Why is that? There's no reason that instantiating
> std::iterator_traits<shared_ptr<T> > should cause a problem by itself.

Try it:

#include <boost/shared_ptr.hpp>
#include <iterator>

int main()
{
    std::iterator_traits< boost::shared_ptr<int> >::value_type i = 0;
}

When you instantiate iterator_traits, all of its typedefs are instantiated.


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