Ticket #1860: zip_iterator.diff

File zip_iterator.diff, 1.7 KB (added by anonymous, 15 years ago)
  • .hpp

    old new  
    349349    {
    350350    };
    351351
     352    template<typename Iterator>
     353    struct iterator_value_type
     354    {
     355        typedef typename iterator_traits<Iterator>::value_type type;
     356    };
     357
     358#ifdef BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
     359    // Hack because BOOST_MPL_AUX_LAMBDA_SUPPORT doesn't seem to work
     360    // out well.  Instantiating the nested apply template also
     361    // requires instantiating iterator_traits on the
     362    // placeholder. Instead we just specialize it as a metafunction
     363    // class.
     364    template<>
     365    struct iterator_value_type<mpl::_1>
     366    {
     367        template <class T>
     368        struct apply : iterator_value_type<T> {};
     369    };
     370#endif
     371   
     372    // Metafunction to obtain the type of the tuple whose element types
     373    // are the reference types of an iterator tuple.
     374    //
     375    template<typename IteratorTuple>
     376    struct tuple_of_value_types
     377      : tuple_impl_specific::tuple_meta_transform<
     378            IteratorTuple,
     379            iterator_value_type<mpl::_1>
     380          >
     381    {
     382    };
     383
    352384    // Metafunction to obtain the minimal traversal tag in a tuple
    353385    // of iterators.
    354386    //
     
    414446        typedef typename
    415447        detail::tuple_of_references<IteratorTuple>::type reference;
    416448     
    417         // Value type is the same as reference type.
    418         typedef reference value_type;
     449        // Value type is a tuple of the iterators' value_types
     450        typedef typename
     451        detail::tuple_of_value_types<IteratorTuple>::type value_type;
    419452     
    420453        // Difference type is the first iterator's difference type
    421454        typedef typename iterator_traits<