Boost logo

Boost :

From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-11-28 18:12:36


See this example, which doesn't compile for now:

    #include <list>
    #include <string>
    #include <boost/tuple/tuple.hpp>
    #include <boost/iterator/zip_iterator.hpp>
    #include <boost/iterator/transform_iterator.hpp>

    int to_value(int const &v)
        return v;

    int main()
        std::list<int> rng1;
        std::string rng2;

                boost::make_transform_iterator(rng1.begin(), &to_value), // BidirectionalInput
                rng2.begin() // RandomAccess

This incurs an error:

    boost::detail::error_not_related_by_convertibility<T1,T2>' : base class undefined


in minimum_traversal_category_in_iterator_tuple.

    template<typename IteratorTuple>
    struct minimum_traversal_category_in_iterator_tuple
      typedef typename tuple_impl_specific::tuple_meta_transform<
        , iterator_traversal<> // !!!!!
>::type tuple_of_traversal_tags;

      // ...

Couldn't "iterator_pure_traversal<>" be used instead of `iterator_traversal<>` here?
The iterator_pure_traversal<> could be something like this:

    template< class Iterator = mpl::_1 >
    struct iterator_pure_traversal :
            typename boost::iterator_traversal<Iterator>::type
    { };

Once Category is turned into pure one, the above example compiles.
Is there any pitfalls if Category is "purified"?


Shunsuke Sogame

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