Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.



      typename Sequences
struct zip_view
    // unspecified


zip_view provides a "zipped" view onto several sequences; that is, it allows to represent several sequences as a single sequence of elements each of those, in its turn, is a sequence of the corresponding Sequences elements.


#include "boost/mpl/zip_view.hpp"


 Parameter  Requirement  Description  
SequencesA Sequence of SequencesSequences to be "zipped".

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef zip_view<Sequences> s;A model of Sequences is a sequence such that for each i in [begin<s>::type, end<s>::type) and for each j in [begin<Sequences>::type, end<Sequences>::type) i::type is identical to transform<j::type, deref<_1> >::type .


Amortized constant time.


typedef range_c<int,0,10> s1;
typedef range_c<int,10,20> s2;

typedef transform_view< zip_view< list<s1,s2> > , apply_seq< plus<_1,_2> > > result;

BOOST_STATIC_ASSERT((equal< result , filter_view< range_c<int,10,30>, math::is_even<_1> > , equal_to<_1,_2> >::type::value));

See also

Sequences, transform_view, filter_view, joint_view, equal

Table of Contents
Last edited March 10, 2003 5:04 am