1 .. Sequences/Intrinsic Metafunctions//insert_range
18 typedef |unspecified| type;
26 ``insert_range`` performs an insertion of a range of elements at an arbitrary position in
34 #include <boost/mpl/insert_range.hpp>
40 |Tag Dispatched Metafunction|
46 +---------------+-----------------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===================================+===============================================+
49 | ``Sequence`` | |Extensible Sequence| or | A sequence to insert into. |
50 | | |Extensible Associative Sequence| | |
51 +---------------+-----------------------------------+-----------------------------------------------+
52 | ``Pos`` | |Forward Iterator| | An iterator in ``Sequence`` specifying the |
53 | | | insertion position. |
54 +---------------+-----------------------------------+-----------------------------------------------+
55 | ``Range`` | |Forward Sequence| | The range of elements to be inserted. |
56 +---------------+-----------------------------------+-----------------------------------------------+
62 For any |Extensible Sequence| ``s``, iterator ``pos`` in ``s``, and |Forward Sequence| ``range``:
66 typedef insert<s,pos,range>::type r;
69 |Extensible Sequence|.
72 ``pos`` is an iterator into ``s``.
75 ``r`` is a sequence, |concept-identical| to ``s``, of the following elements:
76 [``begin<s>::type``, ``pos``), [``begin<r>::type``, ``end<r>::type``),
77 [``pos``, ``end<s>::type``).
80 The relative order of the elements in ``r`` is the same as in ``s``;
84 size<r>::value == size<s>::value + size<range>::value
90 Sequence dependent. Quadratic in the worst case, linear at best; see the particular
91 sequence class' specification for details.
99 typedef vector_c<int,0,1,7,8,9> numbers;
100 typedef find< numbers,integral_c<int,7> >::type pos;
101 typedef insert_range< numbers,pos,range_c<int,2,7> >::type range;
103 BOOST_MPL_ASSERT_RELATION( size<range>::value, ==, 10 );
104 BOOST_MPL_ASSERT(( equal< range,range_c<int,0,10> > ));
106 typedef insert_range<
108 , end< list\ ``0``\ <> >::type
112 BOOST_MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
118 |Extensible Sequence|, |insert|, |push_front|, |push_back|, |erase|
121 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
122 Distributed under the Boost Software License, Version 1.0. (See accompanying
123 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)