Boost logo

Boost Users :

From: Patrik Jonsson (patrik_at_[hidden])
Date: 2008-02-26 17:38:31


Hi,

I'm trying to transparently get the type of a shared_ptr or a pod
pointer using iterator_traits::value_type. This fails on shared_ptr<T>
with the following message:

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_iterator_base_types.h:
In instantiation of 'std::iterator_traits<boost::shared_ptr<int> >':
crap.cc:5: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_iterator_base_types.h:129:
error: no type named 'iterator_category' in 'class boost::shared_ptr<int>'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_iterator_base_types.h:131:
error: no type named 'difference_type' in 'class boost::shared_ptr<int>'

It seems shared_ptr needs difference_type and iterator_category for this
to work. Is there another way to accomplish what I'm trying to do?

Regards,

/Patrik




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