Library Version 12.1.6.2

insert
Prev | Chapter 7. Db_set | Next

## insert

### Function Details

    insert(const value_type &x)

Insert a single key/data pair if the key is not in the container.

#### Parameters

##### x

The key/data pair to insert.

#### Return Value

A pair P, if insert OK, i.e. the inserted key wasn't in the container, P.first will be the iterator positioned on the inserted key/data pair, and P.second is true; otherwise P.first is an invalid iterator equal to that returned by end() and P.second is false.

    void insert(const_iterator &first,
        const_iterator &last)

Range insertion.

Insert a range [first, last) of key/data pairs into this container.

#### Parameters

##### last

The open boundary of the range.

##### first

The closed boundary of the range.

    void insert(iterator &first,
        iterator &last)

Range insertion.

Insert a range [first, last) of key/data pairs into this container.

#### Parameters

##### last

The open boundary of the range.

##### first

The closed boundary of the range.

    iterator insert(iterator position,
        const value_type &x)

Insert with hint position.

We ignore the hint position because Berkeley DB knows better where to insert.

#### Parameters

##### position

The hint position.

##### x

The key/data pair to insert.

#### Return Value

The iterator positioned on the inserted key/data pair, or an invalid iterator if the key was already in the container.

    void insert(InputIterator first,
        InputIterator last)

Range insertion.

Insert a range [first, last) of key/data pairs into this container.

#### Parameters

##### last

The open boundary of the range.

##### first

The closed boundary of the range.

### Group: Insert Functions

http://www.cplusplus.com/reference/set/set/insert/

### Class

db_set

Prev | Up | Next
~db_set | Home | operator=