| 1 | <?xml version="1.0" encoding="utf-8" ?> |
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|---|
| 4 | <!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost --> |
|---|
| 5 | <!-- Software License, Version 1.0. (See accompanying --> |
|---|
| 6 | <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> |
|---|
| 7 | <head> |
|---|
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 9 | <meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" /> |
|---|
| 10 | <title>The MPL Reference Manual: pop_back</title> |
|---|
| 11 | <link rel="stylesheet" href="../style.css" type="text/css" /> |
|---|
| 12 | </head> |
|---|
| 13 | <body class="docframe refmanual"> |
|---|
| 14 | <table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./order.html" class="navigation-link">Prev</a> <a href="./pop-front.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./order.html" class="navigation-link">Back</a> <a href="./pop-front.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./intrinsic-metafunctions.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 15 | <td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./sequences.html" class="navigation-link">Sequences</a> / <a href="./intrinsic-metafunctions.html" class="navigation-link">Intrinsic Metafunctions</a> / <a href="./pop-back.html" class="navigation-link">pop_back</a></td> |
|---|
| 16 | </tr></table><div class="header-separator"></div> |
|---|
| 17 | <div class="section" id="pop-back"> |
|---|
| 18 | <h1><a class="toc-backref" href="./intrinsic-metafunctions.html#id369" name="pop-back">pop_back</a></h1> |
|---|
| 19 | <div class="section" id="pop-synopsis"> |
|---|
| 20 | <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3> |
|---|
| 21 | <pre class="literal-block"> |
|---|
| 22 | template< |
|---|
| 23 | typename Sequence |
|---|
| 24 | > |
|---|
| 25 | struct <a href="./pop-back.html" class="identifier">pop_back</a> |
|---|
| 26 | { |
|---|
| 27 | typedef <em>unspecified</em> type; |
|---|
| 28 | }; |
|---|
| 29 | </pre> |
|---|
| 30 | </div> |
|---|
| 31 | <div class="section" id="pop-description"> |
|---|
| 32 | <h3><a class="subsection-title" href="#description" name="description">Description</a></h3> |
|---|
| 33 | <p><tt class="literal"><span class="pre"><a href="./pop-back.html" class="identifier">pop_back</a></span></tt> performs a removal at the end of the sequence with guaranteed <em>O(1)</em> |
|---|
| 34 | complexity.</p> |
|---|
| 35 | </div> |
|---|
| 36 | <div class="section" id="pop-header"> |
|---|
| 37 | <h3><a class="subsection-title" href="#header" name="header">Header</a></h3> |
|---|
| 38 | <pre class="literal-block"> |
|---|
| 39 | #include <<a href="../../../../boost/mpl/pop_back.hpp" class="header">boost/mpl/pop_back.hpp</a>> |
|---|
| 40 | </pre> |
|---|
| 41 | </div> |
|---|
| 42 | <div class="section" id="pop-model-of"> |
|---|
| 43 | <h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3> |
|---|
| 44 | <p><a class="reference" href="./tag-dispatched.html">Tag Dispatched Metafunction</a></p> |
|---|
| 45 | </div> |
|---|
| 46 | <div class="section" id="pop-parameters"> |
|---|
| 47 | <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3> |
|---|
| 48 | <table border="1" class="table"> |
|---|
| 49 | <colgroup> |
|---|
| 50 | <col width="16%" /> |
|---|
| 51 | <col width="33%" /> |
|---|
| 52 | <col width="51%" /> |
|---|
| 53 | </colgroup> |
|---|
| 54 | <thead valign="bottom"> |
|---|
| 55 | <tr><th>Parameter</th> |
|---|
| 56 | <th>Requirement</th> |
|---|
| 57 | <th>Description</th> |
|---|
| 58 | </tr> |
|---|
| 59 | </thead> |
|---|
| 60 | <tbody valign="top"> |
|---|
| 61 | <tr><td><tt class="literal"><span class="pre">Sequence</span></tt></td> |
|---|
| 62 | <td><a class="reference" href="./back-extensible-sequence.html">Back Extensible Sequence</a></td> |
|---|
| 63 | <td>A sequence to erase the last element from.</td> |
|---|
| 64 | </tr> |
|---|
| 65 | </tbody> |
|---|
| 66 | </table> |
|---|
| 67 | </div> |
|---|
| 68 | <div class="section" id="pop-expression-semantics"> |
|---|
| 69 | <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3> |
|---|
| 70 | <p>For any <a class="reference" href="./back-extensible-sequence.html">Back Extensible Sequence</a> <tt class="literal"><span class="pre">s</span></tt>:</p> |
|---|
| 71 | <pre class="literal-block"> |
|---|
| 72 | typedef <a href="./pop-back.html" class="identifier">pop_back</a><s>::type r; |
|---|
| 73 | </pre> |
|---|
| 74 | <table class="field-list" frame="void" rules="none"> |
|---|
| 75 | <col class="field-name" /> |
|---|
| 76 | <col class="field-body" /> |
|---|
| 77 | <tbody valign="top"> |
|---|
| 78 | <tr class="field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference" href="./back-extensible-sequence.html">Back Extensible Sequence</a>.</td> |
|---|
| 79 | </tr> |
|---|
| 80 | <tr class="field"><th class="field-name">Precondition:</th><td class="field-body"><tt class="literal"><span class="pre"><a href="./empty.html" class="identifier">empty</a><s>::value</span> <span class="pre">==</span> <span class="pre">false</span></tt>.</td> |
|---|
| 81 | </tr> |
|---|
| 82 | <tr class="field"><th class="field-name">Semantics:</th><td class="field-body">Equivalent to <tt class="literal"><span class="pre"><a href="./erase.html" class="identifier">erase</a><s,<a href="./end.html" class="identifier">end</a><s>::type>::type;</span></tt>.</td> |
|---|
| 83 | </tr> |
|---|
| 84 | <tr class="field"><th class="field-name">Postcondition:</th><td class="field-body"><tt class="literal"><span class="pre"><a href="./size.html" class="identifier">size</a><r>::value</span> <span class="pre">==</span> <span class="pre"><a href="./size.html" class="identifier">size</a><s>::value</span> <span class="pre">-</span> <span class="pre">1</span></tt>.</td> |
|---|
| 85 | </tr> |
|---|
| 86 | </tbody> |
|---|
| 87 | </table> |
|---|
| 88 | </div> |
|---|
| 89 | <div class="section" id="pop-complexity"> |
|---|
| 90 | <h3><a class="subsection-title" href="#complexity" name="complexity">Complexity</a></h3> |
|---|
| 91 | <p>Amortized constant time.</p> |
|---|
| 92 | </div> |
|---|
| 93 | <div class="section" id="pop-example"> |
|---|
| 94 | <h3><a class="subsection-title" href="#example" name="example">Example</a></h3> |
|---|
| 95 | <pre class="literal-block"> |
|---|
| 96 | typedef <a href="./vector.html" class="identifier">vector</a><long>::type types1; |
|---|
| 97 | typedef <a href="./vector.html" class="identifier">vector</a><long,int>::type types2; |
|---|
| 98 | typedef <a href="./vector.html" class="identifier">vector</a><long,int,char>::type types3; |
|---|
| 99 | |
|---|
| 100 | typedef <a href="./pop-back.html" class="identifier">pop_back</a><types1>::type result1; |
|---|
| 101 | typedef <a href="./pop-back.html" class="identifier">pop_back</a><types2>::type result2; |
|---|
| 102 | typedef <a href="./pop-back.html" class="identifier">pop_back</a><types3>::type result3; |
|---|
| 103 | |
|---|
| 104 | <a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./size.html" class="identifier">size</a><result1>::value, ==, 0 ); |
|---|
| 105 | <a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./size.html" class="identifier">size</a><result2>::value, ==, 1 ); |
|---|
| 106 | <a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./size.html" class="identifier">size</a><result3>::value, ==, 2 ); |
|---|
| 107 | |
|---|
| 108 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./back.html" class="identifier">back</a><result2>::type, long> )); |
|---|
| 109 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./back.html" class="identifier">back</a><result3>::type, int > )); |
|---|
| 110 | </pre> |
|---|
| 111 | </div> |
|---|
| 112 | <div class="section" id="pop-see-also"> |
|---|
| 113 | <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3> |
|---|
| 114 | <p><a class="reference" href="./back-extensible-sequence.html">Back Extensible Sequence</a>, <a class="refentry reference" href="./erase.html"><tt class="refentry literal"><span class="pre">erase</span></tt></a>, <a class="refentry reference" href="./push-back.html"><tt class="refentry literal"><span class="pre">push_back</span></tt></a>, <a class="refentry reference" href="./back.html"><tt class="refentry literal"><span class="pre">back</span></tt></a>, <a class="refentry reference" href="./pop-front.html"><tt class="refentry literal"><span class="pre">pop_front</span></tt></a></p> |
|---|
| 115 | <!-- modtime: November 13, 2004 01:30:46 +0000 --> |
|---|
| 116 | <!-- Sequences/Intrinsic Metafunctions//pop_front --> |
|---|
| 117 | </div> |
|---|
| 118 | </div> |
|---|
| 119 | |
|---|
| 120 | <div class="footer-separator"></div> |
|---|
| 121 | <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./order.html" class="navigation-link">Prev</a> <a href="./pop-front.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./order.html" class="navigation-link">Back</a> <a href="./pop-front.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./intrinsic-metafunctions.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 122 | </tr></table></body> |
|---|
| 123 | </html> |
|---|