Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > ef9bad9e14fc2a68cb7c992c11d75f5e > files > 3074

libboost1-devel-1.31.0-1mdk.i586.rpm

<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::pop_back</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>pop_back</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
      typename Sequence
    &gt;
struct pop_back
{
    typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>pop_back</code> performs a removal at the end of the sequence. The algorithm returns a new sequence which contains all the elements in the range <code>[begin&lt;Sequence&gt;::type, prior&lt; end&lt;Sequence&gt;::type &gt;::type)</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/pop_back.hpp">boost/mpl/pop_back.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>Sequence</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the erase operation </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 pop_back&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>empty&lt;Sequence&gt;::type::value == false</code></td><td>Equivalent to <code>typedef erase&lt; Sequence, prior&lt; end&lt;Sequence&gt;::type &gt;::type &gt;::type s;</code></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value - 1</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;long&gt;::type types1;
typedef list&lt;long,int&gt;::type types2;
typedef list&lt;long,int,char&gt;::type types3;
<p>
typedef pop_back&lt;types1&gt;::type result1;
typedef pop_back&lt;types2&gt;::type result2;
typedef pop_back&lt;types3&gt;::type result3;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(size&lt;result2&gt;::type::value == 1);
BOOST_STATIC_ASSERT(size&lt;result3&gt;::type::value == 2);
<p>
BOOST_MPL_ASSERT_IS_SAME(<a href="../Reference/back.html">back</a>&lt;result2&gt;::type, long);
BOOST_MPL_ASSERT_IS_SAME(back&lt;result3&gt;::type, int);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>]  The algorithm is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>, <code><a href="../Reference/back.html">back</a></code>, <code><a href="../Reference/pop_front.html">pop_front</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:56 am</body></html>