Files
mpl/doc/ref/Reference/reverse.html

58 lines
2.3 KiB
HTML
Raw Normal View History

2002-09-16 19:25:33 +00:00
<!doctype html public "-//ietf//dtd html//en">
2003-03-12 13:29:12 +00:00
<html><head><title>boost::mpl::reverse</title>
2002-09-16 19:25:33 +00:00
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
2003-03-12 13:29:12 +00:00
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>reverse</h1><h3>Synopsis</h3>
2002-09-16 19:25:33 +00:00
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct reverse
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
2003-03-12 13:29:12 +00:00
<h3>Description</h3>
2002-09-16 19:25:33 +00:00
<p>
2003-03-12 13:29:12 +00:00
Reverses a sequence. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, including its size, but not identity.
2002-09-16 19:25:33 +00:00
<p>
2003-03-12 13:29:12 +00:00
<h3>Definition</h3>
2002-09-16 19:25:33 +00:00
<p>
<pre>
2003-03-12 13:29:12 +00:00
#include "<a href="../../../../../boost/mpl/reverse.hpp">boost/mpl/reverse.hpp</a>"
2002-09-16 19:25:33 +00:00
</pre>
<p>
2003-03-12 13:29:12 +00:00
<h3>Parameters</h3>
2002-09-16 19:25:33 +00:00
<table border="1">
2003-03-12 13:29:12 +00:00
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
2002-09-16 19:25:33 +00:00
</table>
<p>
2003-03-12 13:29:12 +00:00
<h3>Expression semantics</h3>
<p>
2002-09-16 19:25:33 +00:00
<table border="1">
2003-03-12 13:29:12 +00:00
<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 reverse&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value</code>. </td></tr>
2002-09-16 19:25:33 +00:00
</table>
<p>
2003-03-12 13:29:12 +00:00
<h3>Complexity</h3>
2002-09-16 19:25:33 +00:00
<p>
2003-03-12 13:29:12 +00:00
Linear.
2002-09-16 19:25:33 +00:00
<p>
2003-03-12 13:29:12 +00:00
<h3>Example</h3>
2002-09-16 19:25:33 +00:00
<p>
<pre>
2003-03-12 13:29:12 +00:00
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,9,8,7,6,5,4,3,2,1,0&gt;::type numbers;
typedef reverse&lt; numbers &gt;::type result;
<p>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt; answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt;result,answer&gt;::type::value));
2002-09-16 19:25:33 +00:00
</pre>
<p>
2003-03-12 13:29:12 +00:00
<h3>See also</h3>
2002-09-16 19:25:33 +00:00
<p>
2003-03-12 13:29:12 +00:00
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/transform.html">transform</a></code>, <code><a href="../Reference/remove.html">remove</a></code>, <code><a href="../Reference/remove_if.html">remove_if</a></code>
2002-09-16 19:25:33 +00:00
<p><hr>
2003-03-12 13:29:12 +00:00
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:13 am</body></html>