zip_view
template<
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 |
|---|---|---|
Sequences | A Sequence of Sequences | Sequences to be "zipped". |
| Expression | Expression type | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
typedef zip_view<Sequences> s; | A model of Sequence | s 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));
Sequences, transform_view, filter_view, joint_view, equal