]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright 2010 Neil Groves | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | /] | |
6 | [section:insert insert] | |
7 | ||
8 | [heading Prototype] | |
9 | ||
10 | `` | |
11 | template< | |
12 | class Container, | |
13 | class SinglePassRange | |
14 | > | |
15 | Container& insert(Container& target, | |
16 | typename Container::iterator before, | |
17 | const SinglePassRange& from); | |
18 | ||
19 | // This overload is for target containers that do not require an insertion | |
20 | // position e.g. set/map | |
21 | template< | |
22 | class Container, | |
23 | class SinglePassRange | |
24 | > | |
25 | Container& insert(Container& target, const SinglePassRange& from); | |
26 | `` | |
27 | ||
28 | [heading Description] | |
29 | ||
30 | `insert` all of the elements in the range `from` before the `before` iterator into `target`. | |
31 | ||
32 | [heading Definition] | |
33 | ||
34 | Defined in the header file `boost/range/algorithm_ext/insert.hpp` | |
35 | ||
36 | [heading Requirements] | |
37 | ||
38 | # `SinglePassRange` is a model of the __single_pass_range__ Concept. | |
39 | # `Container` supports insert at a specified position. | |
40 | # `SinglePassRange`'s value type is convertible to `Container`'s value type. | |
41 | ||
42 | [heading Complexity] | |
43 | ||
44 | Linear. `distance(from)` assignments are performed. | |
45 | ||
46 | [endsect] |