Back to Arangodb

pop_back

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/pop-back.html

3.12.9.13.1 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / pop_back |

pop_back

Synopsis

template<
      typename Sequence
    >
struct[pop\_back](./pop-back.html){
    typedef_unspecified_type;
};

Description

pop_back performs a removal at the end of the sequence with guaranteed O(1) complexity.

#include <[boost/mpl/pop\_back.hpp](../../../../boost/mpl/pop_back.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceBack Extensible SequenceA sequence to erase the last element from.

Expression semantics

For any Back Extensible Sequence s:

typedef[pop\_back](./pop-back.html)<s>::type r;

| Return type: | Back Extensible Sequence. | | Precondition: | empty<s>::value == false. | | Semantics: | Equivalent to erase<s,end<s>::type>::type;. | | Postcondition: | size<r>::value == size<s>::value - 1. |

Complexity

Amortized constant time.

Example

typedef[vector](./vector.html)<long>::type types1;
typedef[vector](./vector.html)<long,int>::type types2;
typedef[vector](./vector.html)<long,int,char>::type types3;

typedef[pop\_back](./pop-back.html)<types1>::type result1;
typedef[pop\_back](./pop-back.html)<types2>::type result2;
typedef[pop\_back](./pop-back.html)<types3>::type result3;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<result1>::value, ==, 0 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<result2>::value, ==, 1 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<result3>::value, ==, 2 );[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[back](./back.html)<result2>::type, long> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[back](./back.html)<result3>::type, int > ));

See also

Back Extensible Sequence, erase, push_back, back, pop_front

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |