template <typename T, size_t N, typename A = std::allocator<T>>

class InlinedVector

Defined at line 74 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

-----------------------------------------------------------------------------

InlinedVector

-----------------------------------------------------------------------------

An `absl::InlinedVector` is designed to be a drop-in replacement for

`std::vector` for use cases where the vector's size is sufficiently small

that it can be inlined. If the inlined vector does grow beyond its estimated

capacity, it will trigger an initial allocation on the heap, and will behave

as a `std::vector`. The API of the `absl::InlinedVector` within this file is

designed to cover the same API footprint as covered by `std::vector`.

Public Methods

void InlinedVector<T, N, A> ()

Creates an empty inlined vector with a value-initialized allocator.

Defined at line 128 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (const allocator_type & allocator)

Creates an empty inlined vector with a copy of `allocator`.

Defined at line 131 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (size_type n, const allocator_type & allocator)

Creates an inlined vector with `n` copies of `value_type()`.

Defined at line 135 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (size_type n, const_reference v, const allocator_type & allocator)

Creates an inlined vector with `n` copies of `v`.

Defined at line 145 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (std::initializer_list<value_type> list, const allocator_type & allocator)

Creates an inlined vector with copies of the elements of `list`.

Defined at line 155 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename ForwardIterator, EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
void InlinedVector<T, N, A> (ForwardIterator first, ForwardIterator last, const allocator_type & allocator)

Creates an inlined vector with elements constructed from the provided

forward iterator range [`first`, `last`).

NOTE: the `enable_if` prevents ambiguous interpretation between a call to

this constructor with two integral arguments and a call to the above

`InlinedVector(size_type, const_reference)` constructor.

Defined at line 167 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void InlinedVector<T, N, A> (InputIterator first, InputIterator last, const allocator_type & allocator)

Creates an inlined vector with elements constructed from the provided input

iterator range [`first`, `last`).

Defined at line 181 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void InlinedVector<T, N, A> (InputIterator first, InputIterator last, const allocator_type & allocator)

Creates an inlined vector with elements constructed from the provided input

iterator range [`first`, `last`).

Defined at line 181 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (const InlinedVector<T, N, A> & other)

Creates an inlined vector by copying the contents of `other` using

`other`'s allocator.

Defined at line 189 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (const InlinedVector<T, N, A> & other, const allocator_type & allocator)

Creates an inlined vector by copying the contents of `other` using the

provided `allocator`.

Defined at line 194 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (InlinedVector<T, N, A> && other)

Creates an inlined vector by moving in the contents of `other` without

allocating. If `other` contains allocated memory, the newly-created inlined

vector will take ownership of that memory. However, if `other` does not

contain allocated memory, the newly-created inlined vector will perform

element-wise move construction of the contents of `other`.

NOTE: since no allocation is performed for the inlined vector in either

case, the `noexcept(...)` specification depends on whether moving the

underlying objects can throw. It is assumed assumed that...

a) move constructors should only throw due to allocation failure.

b) if `value_type`'s move constructor allocates, it uses the same

allocation function as the inlined vector's allocator.

Thus, the move constructor is non-throwing if the allocator is non-throwing

or `value_type`'s move constructor is specified as `noexcept`.

Defined at line 229 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void InlinedVector<T, N, A> (InlinedVector<T, N, A> && other, const allocator_type & allocator)

Creates an inlined vector by moving in the contents of `other` with a copy

of `allocator`.

NOTE: if `other`'s allocator is not equal to `allocator`, even if `other`

contains allocated memory, this move constructor will still allocate. Since

allocation is performed, this constructor can only be `noexcept` if the

specified allocator is also `noexcept`.

Defined at line 274 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void ~InlinedVector<T, N, A> ()

Defined at line 309 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

bool empty ()

`InlinedVector::empty()`

Returns whether the inlined vector contains no elements.

Defined at line 318 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

size_type size ()

`InlinedVector::size()`

Returns the number of elements in the inlined vector.

Defined at line 323 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

size_type max_size ()

`InlinedVector::max_size()`

Returns the maximum number of elements the inlined vector can hold.

Defined at line 328 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

size_type capacity ()

`InlinedVector::capacity()`

Returns the number of elements that could be stored in the inlined vector

without requiring a reallocation.

NOTE: for most inlined vectors, `capacity()` should be equal to the

template parameter `N`. For inlined vectors which exceed this capacity,

they will no longer be inlined and `capacity()` will equal the capactity of

the allocated memory.

Defined at line 346 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

pointer data ()

`InlinedVector::data()`

Returns a `pointer` to the elements of the inlined vector. This pointer

can be used to access and modify the contained elements.

NOTE: only elements within [`data()`, `data() + size()`) are valid.

Defined at line 357 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_pointer data ()

Overload of `InlinedVector::data()` that returns a `const_pointer` to the

elements of the inlined vector. This pointer can be used to access but not

modify the contained elements.

NOTE: only elements within [`data()`, `data() + size()`) are valid.

Defined at line 367 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reference operator[] (size_type i)

`InlinedVector::operator[](...)`

Returns a `reference` to the `i`th element of the inlined vector.

Defined at line 375 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reference operator[] (size_type i)

Overload of `InlinedVector::operator[](...)` that returns a

`const_reference` to the `i`th element of the inlined vector.

Defined at line 382 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reference at (size_type i)

`InlinedVector::at(...)`

Returns a `reference` to the `i`th element of the inlined vector.

NOTE: if `i` is not within the required range of `InlinedVector::at(...)`,

in both debug and non-debug builds, `std::out_of_range` will be thrown.

Defined at line 393 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reference at (size_type i)

Overload of `InlinedVector::at(...)` that returns a `const_reference` to

the `i`th element of the inlined vector.

NOTE: if `i` is not within the required range of `InlinedVector::at(...)`,

in both debug and non-debug builds, `std::out_of_range` will be thrown.

Defined at line 405 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reference front ()

`InlinedVector::front()`

Returns a `reference` to the first element of the inlined vector.

Defined at line 415 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reference front ()

Overload of `InlinedVector::front()` that returns a `const_reference` to

the first element of the inlined vector.

Defined at line 422 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reference back ()

`InlinedVector::back()`

Returns a `reference` to the last element of the inlined vector.

Defined at line 430 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reference back ()

Overload of `InlinedVector::back()` that returns a `const_reference` to the

last element of the inlined vector.

Defined at line 437 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator begin ()

`InlinedVector::begin()`

Returns an `iterator` to the beginning of the inlined vector.

Defined at line 445 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_iterator begin ()

Overload of `InlinedVector::begin()` that returns a `const_iterator` to

the beginning of the inlined vector.

Defined at line 449 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator end ()

`InlinedVector::end()`

Returns an `iterator` to the end of the inlined vector.

Defined at line 456 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_iterator end ()

Overload of `InlinedVector::end()` that returns a `const_iterator` to the

end of the inlined vector.

Defined at line 462 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_iterator cbegin ()

`InlinedVector::cbegin()`

Returns a `const_iterator` to the beginning of the inlined vector.

Defined at line 469 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_iterator cend ()

`InlinedVector::cend()`

Returns a `const_iterator` to the end of the inlined vector.

Defined at line 476 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reverse_iterator rbegin ()

`InlinedVector::rbegin()`

Returns a `reverse_iterator` from the end of the inlined vector.

Defined at line 483 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reverse_iterator rbegin ()

Overload of `InlinedVector::rbegin()` that returns a

`const_reverse_iterator` from the end of the inlined vector.

Defined at line 489 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

reverse_iterator rend ()

`InlinedVector::rend()`

Returns a `reverse_iterator` from the beginning of the inlined vector.

Defined at line 496 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reverse_iterator rend ()

Overload of `InlinedVector::rend()` that returns a `const_reverse_iterator`

from the beginning of the inlined vector.

Defined at line 502 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reverse_iterator crbegin ()

`InlinedVector::crbegin()`

Returns a `const_reverse_iterator` from the end of the inlined vector.

Defined at line 509 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

const_reverse_iterator crend ()

`InlinedVector::crend()`

Returns a `const_reverse_iterator` from the beginning of the inlined

vector.

Defined at line 518 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

allocator_type get_allocator ()

`InlinedVector::get_allocator()`

Returns a copy of the inlined vector's allocator.

Defined at line 525 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

InlinedVector<T, N, A> & operator= (std::initializer_list<value_type> list)

`InlinedVector::operator=(...)`

Replaces the elements of the inlined vector with copies of the elements of

`list`.

Defined at line 535 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

InlinedVector<T, N, A> & operator= (const InlinedVector<T, N, A> & other)

Overload of `InlinedVector::operator=(...)` that replaces the elements of

the inlined vector with copies of the elements of `other`.

Defined at line 543 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

InlinedVector<T, N, A> & operator= (InlinedVector<T, N, A> && other)

Overload of `InlinedVector::operator=(...)` that moves the elements of

`other` into the inlined vector.

NOTE: as a result of calling this overload, `other` is left in a valid but

unspecified state.

Defined at line 557 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void assign (size_type n, const_reference v)

`InlinedVector::assign(...)`

Replaces the contents of the inlined vector with `n` copies of `v`.

Defined at line 568 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void assign (std::initializer_list<value_type> list)

Overload of `InlinedVector::assign(...)` that replaces the contents of the

inlined vector with copies of the elements of `list`.

Defined at line 577 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename ForwardIterator, EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
void assign (ForwardIterator first, ForwardIterator last)

Overload of `InlinedVector::assign(...)` to replace the contents of the

inlined vector with the range [`first`, `last`).

NOTE: this overload is for iterators that are "forward" category or better.

Defined at line 587 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void assign (InputIterator first, InputIterator last)

Overload of `InlinedVector::assign(...)` to replace the contents of the

inlined vector with the range [`first`, `last`).

NOTE: this overload is for iterators that are "input" category.

Defined at line 601 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void assign (InputIterator first, InputIterator last)

Overload of `InlinedVector::assign(...)` to replace the contents of the

inlined vector with the range [`first`, `last`).

NOTE: this overload is for iterators that are "input" category.

Defined at line 601 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void resize (size_type n)

`InlinedVector::resize(...)`

Resizes the inlined vector to contain `n` elements.

NOTE: If `n` is smaller than `size()`, extra elements are destroyed. If `n`

is larger than `size()`, new elements are value-initialized.

Defined at line 617 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void resize (size_type n, const_reference v)

Overload of `InlinedVector::resize(...)` that resizes the inlined vector to

contain `n` elements.

NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n`

is larger than `size()`, new elements are copied-constructed from `v`.

Defined at line 629 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator insert (const_iterator pos, const_reference v)

`InlinedVector::insert(...)`

Inserts a copy of `v` at `pos`, returning an `iterator` to the newly

inserted element.

Defined at line 640 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator insert (const_iterator pos, value_type && v)

Overload of `InlinedVector::insert(...)` that inserts `v` at `pos` using

move semantics, returning an `iterator` to the newly inserted element.

Defined at line 647 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator insert (const_iterator pos, size_type n, const_reference v)

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.

Defined at line 655 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator insert (const_iterator pos, std::initializer_list<value_type> list)

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.

Defined at line 687 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

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

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.

NOTE: this overload is for iterators that are "forward" category or better.

Defined at line 699 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

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

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.

NOTE: this overload is for iterators that are "input" category.

Defined at line 723 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

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

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.

NOTE: this overload is for iterators that are "input" category.

Defined at line 723 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename... Args>
iterator emplace (const_iterator pos, Args &&... args)

`InlinedVector::emplace(...)`

Constructs and inserts an element using `args...` in the inlined vector at

`pos`, returning an `iterator` pointing to the newly emplaced element.

Defined at line 741 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

template <typename... Args>
reference emplace_back (Args &&... args)

`InlinedVector::emplace_back(...)`

Constructs and inserts an element using `args...` in the inlined vector at

`end()`, returning a `reference` to the newly emplaced element.

Defined at line 773 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void push_back (const_reference v)

`InlinedVector::push_back(...)`

Inserts a copy of `v` in the inlined vector at `end()`.

Defined at line 783 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void push_back (value_type && v)

Overload of `InlinedVector::push_back(...)` for inserting `v` at `end()`

using move semantics.

Defined at line 787 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void pop_back ()

`InlinedVector::pop_back()`

Destroys the element at `back()`, reducing the size by `1`.

Defined at line 794 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator erase (const_iterator pos)

`InlinedVector::erase(...)`

Erases the element at `pos`, returning an `iterator` pointing to where the

erased element was located.

NOTE: may return `end()`, which is not dereferenceable.

Defined at line 807 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

iterator erase (const_iterator from, const_iterator to)

Overload of `InlinedVector::erase(...)` that erases every element in the

range [`from`, `to`), returning an `iterator` pointing to where the first

erased element was located.

NOTE: may return `end()`, which is not dereferenceable.

Defined at line 832 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void clear ()

`InlinedVector::clear()`

Destroys all elements in the inlined vector, setting the size to `0` and

preserving capacity.

Defined at line 849 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void reserve (size_type n)

`InlinedVector::reserve(...)`

Ensures that there is enough room for at least `n` elements.

Defined at line 858 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void shrink_to_fit ()

`InlinedVector::shrink_to_fit()`

Attempts to reduce memory usage by moving elements to (or keeping elements

in) the smallest available buffer sufficient for containing `size()`

elements.

If `size()` is sufficiently small, the elements will be moved into (or kept

in) the inlined space.

Defined at line 873 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

void swap (InlinedVector<T, N, A> & other)

`InlinedVector::swap(...)`

Swaps the contents of the inlined vector with `other`.

Defined at line 882 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h

Friends

template <typename Htypename TheTsize_t TheNtypename TheA>
H InlinedVector (H hconst absl::InlinedVector<TheT, TheN, TheA> & a)