absl::InlinedVector::insert

insert overloads

Synopses

Declared in <absl/container/inlined_vector.h>

Inserts a copy of v at pos, returning an iterator to the newly inserted element.

iterator
insert(
    const_iterator pos,
    const_reference v);
» more...

Overload of InlinedVector::insert(...) that inserts copies of the elements of list starting at pos, returning an iterator pointing to the first of the newly inserted elements.

iterator
insert(
    const_iterator pos,
    std::initializer_list<value_type> list);
» more...

Overload of InlinedVector::insert(...) that inserts v at pos using move semantics, returning an iterator to the newly inserted element.

iterator
insert(
    const_iterator pos,
    value_type&& v);
» more...

Overload of InlinedVector::insert(...) that inserts n contiguous copies of v starting at pos, returning an iterator pointing to the first of the newly inserted elements.

iterator
insert(
    const_iterator pos,
    size_type n,
    const_reference v);
» more...

Overload of InlinedVector::insert(...) that inserts the range [first,] last) starting at pos, returning an iterator pointing to the first of the newly inserted elements.

template<
    typename ForwardIterator,
    EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
iterator
insert(
    const_iterator pos,
    ForwardIterator first,
    ForwardIterator last);
» more...

Overload of InlinedVector::insert(...) that inserts the range [first,] last) starting at pos, returning an iterator pointing to the first of the newly inserted elements.

template<
    typename InputIterator,
    DisableIfAtLeastForwardIterator<InputIterator> = 0>
iterator
insert(
    const_iterator pos,
    InputIterator first,
    InputIterator last);
» more...

Overload of InlinedVector::insert(...) that inserts the range [first,] last) starting at pos, returning an iterator pointing to the first of the newly inserted elements.

template<
    typename InputIterator,
    DisableIfAtLeastForwardIterator<InputIterator> = 0>
iterator
insert(
    const_iterator pos,
    InputIterator first,
    InputIterator last);
» more...

Return Value

  • An iterator to the newly inserted element.
  • An iterator to the first newly inserted element.

Parameters

NameDescription
posThe position at which to insert.
vThe value to copy.
listThe initializer list to copy elements from.
nThe number of copies to insert.
firstAn iterator to the beginning of the range.
lastAn iterator past the end of the range.