Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-11-06 10:59:44


Neal Becker <ndbecker2_at_[hidden]> writes:

> This simple test illustrates the problem:
>
> #include <boost/iterator/permutation_iterator.hpp>
> #include <vector>
> #include <boost/range.hpp>
>
> template<typename in_t>
> void F (in_t const& in) {
> typename boost::range_const_iterator<in_t>::type inp = boost::begin (in);
> }
>
> int main () {
> std::vector<int> x, y;
> F (boost::make_permutation_iterator (boost::begin (x), boost::begin (y)));
> }
>
> /usr/local/src/boost.hg/boost/range/const_iterator.hpp:37: error: no type
> named
> const_iterator in class
> boost::permutation_iterator<__gnu_cxx::__normal_iterator<int*,
> std::vector<int, std::allocator<int> > >,
> __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >
>>

This has nothing to do with permutation iterator at all. An iterator
is not expected to have a const_iterator member. It looks for all the
world like user error: F expects a model of Range, and you're just
passing a model of Iterator.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk