| Home | Libraries | People | FAQ | More

##### insert

###### Prototype

    template<
        class Container,
        class SinglePassRange
    >
    Container& insert(Container& target,
                      typename Container::iterator before,
                      const SinglePassRange& from);

    // This overload is for target containers that do not require an insertion
    // position e.g. set/map
    template<
        class Container,
        class SinglePassRange
    >
    Container& insert(Container& target, const SinglePassRange& from);

###### Description

`insert` all of the elements in the range `from` before the `before` iterator into `target`.

###### Definition

Defined in the header file `boost/range/algorithm_ext/insert.hpp`

###### Requirements

1. `SinglePassRange` is a model of the Single Pass Range Concept.
2. `Container` supports insert at a specified position.
3. `SinglePassRange`'s value type is convertible to `Container`'s value type.

###### Complexity

Linear. `distance(from)` assignments are performed.