template <typename T, size_t N, typename A = std::allocator<T>>
class InlinedVector
Defined at line 73 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 127 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 130 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 134 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
void InlinedVector<T, N, A> (size_typen,const_referencev,const allocator_type &allocator)
Creates an inlined vector with `n` copies of `v`.
Defined at line 141 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 148 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename ForwardIterator, EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
void InlinedVector<T, N, A> (ForwardIteratorfirst,ForwardIteratorlast,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 160 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void InlinedVector<T, N, A> (InputIteratorfirst,InputIteratorlast,const allocator_type &allocator)
Creates an inlined vector with elements constructed from the provided input
iterator range [`first`, `last`).
Defined at line 171 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
void InlinedVector<T, N, A> (InputIteratorfirst,InputIteratorlast,const allocator_type &allocator)
Creates an inlined vector with elements constructed from the provided input
iterator range [`first`, `last`).
Defined at line 171 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 179 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 184 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 219 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 264 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
void ~InlinedVector<T, N, A> ()
Defined at line 299 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 308 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 313 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 318 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 336 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 347 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 357 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 365 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 372 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 383 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 396 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 407 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 414 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 422 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 429 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 437 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 441 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 448 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 454 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 461 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 468 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 475 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 481 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 488 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 494 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 501 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 510 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 517 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 527 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 535 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 549 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 560 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 566 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 576 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 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 587 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 603 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 613 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 622 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 629 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
iterator insert (const_iteratorpos,size_typen,const_referencev)
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 637 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 666 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename ForwardIterator, EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
iterator insert (const_iteratorpos,ForwardIteratorfirst,ForwardIteratorlast)
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 678 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
iterator insert (const_iteratorpos,InputIteratorfirst,InputIteratorlast)
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 699 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
template <typename InputIterator, DisableIfAtLeastForwardIterator<InputIterator> = 0>
iterator insert (const_iteratorpos,InputIteratorfirst,InputIteratorlast)
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 699 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 717 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 746 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 753 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 757 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 764 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 777 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 802 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 819 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 828 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 838 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 847 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)