Boost logo

Boost :

Subject: [boost] [iterators] zip_iterator requires random_access_iterator?
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2009-09-12 08:45:09


Hi Everyone,

According to the documentation
(http://www.boost.org/doc/libs/1_40_0/libs/iterator/doc/zip_iterator.html):

  All iterator types in the argument IteratorTuple shall model
Readable Iterator.

When I use a BidirectionalIterator (list<...>::iterator) zip_iterator
fails to compile, while when I use a RandomAccessIterator
(vector<...>) it compiles just fine. I have a nesting like this:

  make_filter_iterator(
    filter(),
    make_zip_iterator(
      make_tuple(
        container.begin(),
        make_transform_iterator(
          container.begin(),
          function()
        )
    )
  )

The first line in the error logs is:

/home/dean/boost/boost/iterator/detail/minimum_category.hpp: In
instantiation of ‘boost::detail::minimum_category_impl<false,
false>::apply<boost::detail::iterator_category_with_traversal<std::input_iterator_tag,
boost::bidirectional_traversal_tag>,
boost::random_access_traversal_tag>

I'm using Boost SVN trunk updated to revision 56153 -- did I find a bug?

HTH

-- 
Dean Michael Berris
blog.cplusplus-soup.com | twitter.com/mikhailberis
linkedin.com/in/mikhailberis | facebook.com/dean.berris | deanberris.com

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