Back to Arangodb

insert_range

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/insert-range.html

3.12.9.13.8 KB
Original Source

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

insert_range

Synopsis

template<
      typename Sequence
    , typename Pos
    , typename Range
    >
struct[insert\_range](./insert-range.html){
    typedef_unspecified_type;
};

Description

insert_range performs an insertion of a range of elements at an arbitrary position in the sequence.

#include <[boost/mpl/insert\_range.hpp](../../../../boost/mpl/insert_range.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceExtensible Sequence or Extensible Associative SequenceA sequence to insert into.
PosForward IteratorAn iterator in Sequence specifying the insertion position.
RangeForward SequenceThe range of elements to be inserted.

Expression semantics

For any Extensible Sequence s, iterator pos in s, and Forward Sequence range:

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

| Return type: |

Extensible Sequence.

| | Precondition: |

pos is an iterator into s.

| | Semantics: |

r is a sequence, concept-identical to s, of the following elements: [begin<s>::type, pos), [begin<r>::type, end<r>::type), [pos, end<s>::type).

| | Postcondition: |

The relative order of the elements in r is the same as in s;

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

|

Complexity

Sequence dependent. Quadratic in the worst case, linear at best; see the particular sequence class' specification for details.

Example

typedef[vector\_c](./vector-c.html)<int,0,1,7,8,9> numbers;
typedef[find](./find.html)< numbers,[integral\_c](./integral-c.html)<int,7> >::type pos;
typedef[insert\_range](./insert-range.html)< numbers,pos,[range\_c](./range-c.html)<int,2,7> >::type range;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<range>::value, ==, 10 );[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)< range,[range\_c](./range-c.html)<int,0,10> > ));

typedef[insert\_range](./insert-range.html)<[list](./list.html)0<>
    ,[end](./end.html)<[list](./list.html)0<> >::type
    ,[list](./list.html)<int>
    >::type result2;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<result2>::value, ==, 1 );

See also

Extensible Sequence, insert, push_front, push_back, erase

| 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) |