1 .. Sequences/Intrinsic Metafunctions//pop_back
16 typedef |unspecified| type;
23 ``pop_back`` performs a removal at the end of the sequence with guaranteed |O(1)|
32 #include <boost/mpl/pop_back.hpp>
38 |Tag Dispatched Metafunction|
44 +---------------+-------------------------------+-----------------------------------------------+
45 | Parameter | Requirement | Description |
46 +===============+===============================+===============================================+
47 | ``Sequence`` | |Back Extensible Sequence| | A sequence to erase the last element from. |
48 +---------------+-------------------------------+-----------------------------------------------+
54 For any |Back Extensible Sequence| ``s``:
58 typedef pop_back<s>::type r;
61 |Back Extensible Sequence|.
64 ``empty<s>::value == false``.
67 Equivalent to ``erase<s,end<s>::type>::type;``.
70 ``size<r>::value == size<s>::value - 1``.
76 Amortized constant time.
84 typedef vector<long>::type types1;
85 typedef vector<long,int>::type types2;
86 typedef vector<long,int,char>::type types3;
88 typedef pop_back<types1>::type result1;
89 typedef pop_back<types2>::type result2;
90 typedef pop_back<types3>::type result3;
92 BOOST_MPL_ASSERT_RELATION( size<result1>::value, ==, 0 );
93 BOOST_MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
94 BOOST_MPL_ASSERT_RELATION( size<result3>::value, ==, 2 );
96 BOOST_MPL_ASSERT(( is_same< back<result2>::type, long> ));
97 BOOST_MPL_ASSERT(( is_same< back<result3>::type, int > ));
103 |Back Extensible Sequence|, |erase|, |push_back|, |back|, |pop_front|
106 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
107 Distributed under the Boost Software License, Version 1.0. (See accompanying
108 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)