2002-09-16 19:25:33 +00:00
<!doctype html public "-//ietf//dtd html//en">
2003-03-12 13:29:12 +00:00
< html > < head > < title > boost::mpl::pop_front< / title >
2002-09-16 19:25:33 +00:00
< link rel = "stylesheet" href = "../mpl_wiki.css" >
< / head > < body bgcolor = "white" >
2003-03-12 13:29:12 +00:00
< h1 > < a href = "../Table_of_Contents.html" > < img src = "../mpl_logo.jpg" alt = "[Home]" border = 0 align = "right" > < / a > pop_front< / h1 > < h3 > Synopsis< / h3 >
2002-09-16 19:25:33 +00:00
< p >
< pre >
template<
typename Sequence
>
struct pop_front
{
typedef < em > unspecified< / em > type;
};
< / pre >
< p >
< h3 > Description< / h3 >
< p >
< code > pop_front< / code > performs a removal at the beginning of the sequence. The algorithm returns a new sequence which contains all the elements in the range < code > [next< begin< Sequence> ::type > ::type, end< Sequence> ::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 >
2003-03-12 13:29:12 +00:00
#include "< a href = "../../../../../boost/mpl/pop_front.hpp" > boost/mpl/pop_front.hpp< / a > "
2002-09-16 19:25:33 +00:00
< / 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 > A sequence to handle the erase operation < / 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 pop_front< Sequence> ::type s;< / code > < / td > < td > A model of < a href = "../Extensible_Sequence.html" > Extensible Sequence< / a > < / td > < td > < code > empty< Sequence> ::type::value == false< / code > < / td > < td > Equivalent to < code > typedef erase< Sequence, begin< Sequence> ::type > ::type s;< / code > < / td > < td > < code > size< s> ::type::value == size< Sequence> ::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 > < long> ::type types1;
typedef < a href = "../Reference/list.html" > list< / a > < int,long> ::type types2;
typedef < a href = "../Reference/list.html" > list< / a > < char,int,long> ::type types3;
< p >
typedef pop_front< types1> ::type result1;
typedef pop_front< types2> ::type result2;
typedef pop_front< types3> ::type result3;
< p >
BOOST_STATIC_ASSERT(< a href = "../Reference/size.html" > size< / a > < result1> ::type::value == 0);
BOOST_STATIC_ASSERT(size< result2> ::type::value == 1);
BOOST_STATIC_ASSERT(size< result3> ::type::value == 2);
< p >
BOOST_MPL_ASSERT_IS_SAME(< a href = "../Reference/front.html" > front< / a > < result2> ::type, long);
BOOST_MPL_ASSERT_IS_SAME(front< result3> ::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_front.html" > push_front< / a > < / code > , < code > < a href = "../Reference/front.html" > front< / a > < / code > , < code > < a href = "../Reference/pop_back.html" > pop_back< / a > < / code >
< p > < hr >
2003-03-12 13:29:12 +00:00
< a href = "../Table_of_Contents.html" > Table of Contents< / a > < br > Last edited July 17, 2002 3:54 am< / body > < / html >