Files
mpl/doc/ref/Reference/zip_view.html
Aleksey Gurtovoy a69baa5eae update the docs
[SVN r17836]
2003-03-12 13:29:12 +00:00

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&lt;
typename Sequences
&gt;
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>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</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>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef zip_view&lt;Sequences&gt; 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>&lt;s&gt;::type, <a href="../Reference/end.html">end</a>&lt;s&gt;::type)</code> and for each <code>j</code> in <code>[<a href="../Reference/begin.html">begin</a>&lt;Sequences&gt;::type, <a href="../Reference/end.html">end</a>&lt;Sequences&gt;::type)</code> <code>i::type</code> is identical to <code><a href="../Reference/transform.html">transform</a>&lt;j::type, <a href="../Reference/deref.html">deref</a>&lt;_1&gt; &gt;::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>&lt;int,0,10&gt; s1;
typedef range_c&lt;int,10,20&gt; s2;
<p>
typedef <a href="../Reference/transform_view.html">transform_view</a>&lt;
<a href="../Reference/zip_view.html">zip_view</a>&lt; <a href="../Reference/list.html">list</a>&lt;s1,s2&gt; &gt;
, apply_seq&lt; <a href="../Reference/plus.html">plus</a>&lt;_1,_2&gt; &gt;
&gt; result;
<p>
BOOST_STATIC_ASSERT((equal&lt;
result
, <a href="../Reference/filter_view.html">filter_view</a>&lt; range_c&lt;int,10,30&gt;, math::is_even&lt;_1&gt; &gt;
, <a href="../Reference/equal_to.html">equal_to</a>&lt;_1,_2&gt;
&gt;::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>