.. Sequences/Views//zip_view zip_view ======== Synopsis -------- .. parsed-literal:: template< typename Sequences > struct zip_view { // |unspecified| // |...| }; Description ----------- Provides a "zipped" view onto several sequences; that is, represents several sequences as a single sequence of elements each of which, in turn, is a sequence of the corresponding ``Sequences``\ ' elements. Header ------ .. parsed-literal:: #include Model of -------- * |Forward Sequence| Parameters ---------- +---------------+-----------------------------------+-------------------------------+ | Parameter | Requirement | Description | +===============+===================================+===============================+ | ``Sequences`` | A |Forward Sequence| of | Sequences to be "zipped". | | | |Forward Sequence|\ s | | +---------------+-----------------------------------+-------------------------------+ Expression semantics -------------------- |Semantics disclaimer...| |Forward Sequence|. In the following table, ``v`` is an instance of ``zip_view``, ``seq`` a |Forward Sequence| of ``n`` |Forward Sequence|\ s. +-------------------------------+-----------------------------------------------------------+ | Expression | Semantics | +===============================+===========================================================+ | .. parsed-literal:: | A lazy |Forward Sequence| ``v`` such that for each ``i`` | | | in |begin/end| and for each ``j`` in | | zip_view | [``begin::type``, ``end::type``) | | zip_view::type | ``deref::type`` is identical to | | | ``transform< deref::type, deref<_1> >::type``. | +-------------------------------+-----------------------------------------------------------+ | ``size::type`` | The size of ``v``; ``size::value`` is equal to | | | :: | | | | | | deref< min_element< | | | transform_view< seq, size<_1> > | | | >::type >::type::value; | | | | | | linear complexity; see |Forward Sequence|. | +-------------------------------+-----------------------------------------------------------+ Example ------- Element-wise sum of three vectors. .. parsed-literal:: typedef vector_c v1; typedef vector_c v2; typedef vector_c v3; typedef transform_view< zip_view< vector > , unpack_args< plus<_1,_2,_3> > > sum; BOOST_MPL_ASSERT(( equal< sum, vector_c > )); See also -------- |Sequences|, |Views|, |filter_view|, |transform_view|, |joint_view|, |single_view|, |iterator_range|