mirror of
https://github.com/boostorg/mpl.git
synced 2026-01-26 17:02:20 +01:00
66 lines
3.3 KiB
HTML
66 lines
3.3 KiB
HTML
<!doctype html public "-//ietf//dtd html//en">
|
|
<html><head><title>boost::mpl::zip_view</title>
|
|
<link rel="stylesheet" href="../mpl_wiki.css">
|
|
</head><body bgcolor="white">
|
|
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>zip_view</h1><h3>Synopsis</h3>
|
|
<p>
|
|
<pre>
|
|
template<
|
|
typename Sequences
|
|
>
|
|
struct zip_view
|
|
{
|
|
<span class="cxx-comment">// unspecified</span>
|
|
};
|
|
</pre>
|
|
<p>
|
|
<h3>Description</h3>
|
|
<p>
|
|
<code>zip_view</code> 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 <code>Sequences</code> elements.
|
|
<p>
|
|
<h3>Definition</h3>
|
|
<p>
|
|
<pre>
|
|
#include "<a href="../../../../../boost/mpl/zip_view.hpp">boost/mpl/zip_view.hpp</a>"
|
|
</pre>
|
|
<p>
|
|
<h3>Parameters</h3>
|
|
<table border="1">
|
|
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
|
<tr><td><code>Sequences</code></td><td>A <a href="../Sequence.html">Sequence</a> of <a href="../Sequence.html">Sequence</a>s</td><td>Sequences to be "zipped". </td></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Expression semantics</h3>
|
|
<p>
|
|
<table border="1">
|
|
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
|
<tr><td><code>typedef zip_view<Sequences> s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> is a sequence such that for each <code>i</code> in <code>[<a href="../Reference/begin.html">begin</a><s>::type, <a href="../Reference/end.html">end</a><s>::type)</code> and for each <code>j</code> in <code>[<a href="../Reference/begin.html">begin</a><Sequences>::type, <a href="../Reference/end.html">end</a><Sequences>::type)</code> <code>i::type</code> is identical to <code><a href="../Reference/transform.html">transform</a><j::type, <a href="../Reference/deref.html">deref</a><_1> >::type </code>.</td><td></td></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Complexity</h3>
|
|
<p>
|
|
Amortized constant time.
|
|
<p>
|
|
<h3>Example</h3>
|
|
<p>
|
|
<pre>
|
|
typedef <a href="../Reference/range_c.html">range_c</a><int,0,10> s1;
|
|
typedef range_c<int,10,20> s2;
|
|
<p>
|
|
typedef <a href="../Reference/transform_view.html">transform_view</a><
|
|
<a href="../Reference/zip_view.html">zip_view</a>< <a href="../Reference/list.html">list</a><s1,s2> >
|
|
, apply_seq< <a href="../Reference/plus.html">plus</a><_1,_2> >
|
|
> result;
|
|
<p>
|
|
BOOST_STATIC_ASSERT((equal<
|
|
result
|
|
, <a href="../Reference/filter_view.html">filter_view</a>< range_c<int,10,30>, math::is_even<_1> >
|
|
, <a href="../Reference/equal_to.html">equal_to</a><_1,_2>
|
|
>::type::value));
|
|
</pre>
|
|
<p>
|
|
<h3>See also</h3>
|
|
<p>
|
|
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/joint_view.html">joint_view</a></code>, <code><a href="../Reference/equal.html">equal</a></code>
|
|
<p><hr>
|
|
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:04 am</body></html> |