mirror of
https://github.com/boostorg/mpl.git
synced 2026-01-26 08:52:21 +01:00
58 lines
2.3 KiB
HTML
58 lines
2.3 KiB
HTML
<!doctype html public "-//ietf//dtd html//en">
|
|
<html><head><title>boost::mpl::reverse</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>reverse</h1><h3>Synopsis</h3>
|
|
<p>
|
|
<pre>
|
|
template<
|
|
typename Sequence
|
|
>
|
|
struct reverse
|
|
{
|
|
typedef <em>implementation-defined</em> type;
|
|
};
|
|
</pre>
|
|
<p>
|
|
<h3>Description</h3>
|
|
<p>
|
|
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.
|
|
<p>
|
|
<h3>Definition</h3>
|
|
<p>
|
|
<pre>
|
|
#include "<a href="../../../../../boost/mpl/reverse.hpp">boost/mpl/reverse.hpp</a>"
|
|
</pre>
|
|
<p>
|
|
<h3>Parameters</h3>
|
|
<table border="1">
|
|
<tr><th> Parameter </th><th> Requirement </th><th> Description </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>
|
|
</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 reverse<Sequence>::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td></td><td><code>size<s>::type::value == size<Sequence>::type::value</code>. </td></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Complexity</h3>
|
|
<p>
|
|
Linear.
|
|
<p>
|
|
<h3>Example</h3>
|
|
<p>
|
|
<pre>
|
|
typedef <a href="../Reference/list_c.html">list_c</a><int,9,8,7,6,5,4,3,2,1,0>::type numbers;
|
|
typedef reverse< numbers >::type result;
|
|
<p>
|
|
typedef <a href="../Reference/range_c.html">range_c</a><int,0,10> answer;
|
|
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a><result,answer>::type::value));
|
|
</pre>
|
|
<p>
|
|
<h3>See also</h3>
|
|
<p>
|
|
<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>
|
|
<p><hr>
|
|
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:13 am</body></html> |