Back to Arangodb

push_back

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

3.12.9.12.9 KB
Original Source

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

push_back

Synopsis

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

Description

push_back performs an insertion at the end of the sequence with guaranteed O(1) complexity.

#include <[boost/mpl/push\_back.hpp](../../../../boost/mpl/push_back.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceBack Extensible SequenceA sequence to insert into.
TAny typeThe element to be inserted.

Expression semantics

For any Back Extensible Sequence s and arbitrary type x:

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

| Return type: |

Back Extensible Sequence.

| | Semantics: |

Equivalent to

typedef[insert](./insert.html)< s,[end](./end.html)<s>::type,x >::type r;

| | Postcondition: |

back<r>::type is identical to x;

[size](./size.html)<r>::value ==[size](./size.html)<s>::value + 1

|

Complexity

Amortized constant time.

Example

typedef[vector\_c](./vector-c.html)<bool,false,false,false,
    true,true,true,false,false> bools;

typedef[push\_back](./push-back.html)<bools,[false\_](./bool.html)>::type message;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([back](./back.html)<message>::type::value, ==, false );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)(
      ([count\_if](./count-if.html)<message,[equal\_to](./equal-to.html)<[\_1](./placeholders.html),[false\_](./bool.html)> >::value ), ==, 6
    );

See also

Back Extensible Sequence, insert, pop_back, back, push_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) |