1 .. Sequences/Intrinsic Metafunctions//pop_front
16 typedef |unspecified| type;
24 ``pop_front`` performs a removal at the beginning of the sequence with guaranteed |O(1)|
33 #include <boost/mpl/pop_front.hpp>
40 |Tag Dispatched Metafunction|
46 +---------------+-----------------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===================================+===============================================+
49 | ``Sequence`` | |Front Extensible Sequence| | A sequence to erase the first element from. |
50 +---------------+-----------------------------------+-----------------------------------------------+
56 For any |Front Extensible Sequence| ``s``:
60 typedef pop_front<s>::type r;
63 |Front Extensible Sequence|.
66 ``empty<s>::value == false``.
69 Equivalent to ``erase<s,begin<s>::type>::type;``.
72 ``size<r>::value == size<s>::value - 1``.
78 Amortized constant time.
86 typedef vector<long>::type types1;
87 typedef vector<int,long>::type types2;
88 typedef vector<char,int,long>::type types3;
90 typedef pop_front<types1>::type result1;
91 typedef pop_front<types2>::type result2;
92 typedef pop_front<types3>::type result3;
94 BOOST_MPL_ASSERT_RELATION( size<result1>::value, ==, 0 );
95 BOOST_MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
96 BOOST_MPL_ASSERT_RELATION( size<result3>::value, ==, 2 );
98 BOOST_MPL_ASSERT(( is_same< front<result2>::type, long > ));
99 BOOST_MPL_ASSERT(( is_same< front<result3>::type, int > ));
105 |Front Extensible Sequence|, |erase|, |push_front|, |front|, |pop_back|
108 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
109 Distributed under the Boost Software License, Version 1.0. (See accompanying
110 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)