[#absl-InlinedVector]
= xref:absl.adoc[absl]::InlinedVector
:relfileprefix: ../
:mrdocs:

A drop&hyphen;in replacement for `std&colon;&colon;vector` that stores small sequences inline&period;

== Synopsis

Declared in `&lt;absl&sol;container&sol;inlined&lowbar;vector&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    size&lowbar;t N,
    typename A = std::allocator&lt;T&gt;&gt;
class InlinedVector;
----

== Description

An `absl&colon;&colon;InlinedVector` is designed to be a drop&hyphen;in replacement for `std&colon;&colon;vector` for use cases where the vector&apos;s size is sufficiently small that it can be inlined&period; 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&colon;&colon;vector`&period; The API of the `absl&colon;&colon;InlinedVector` within this file is designed to cover the same API footprint as covered by `std&colon;&colon;vector`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:absl/InlinedVector/allocator_type.adoc[`allocator&lowbar;type`] 
| The allocator type used by the inlined vector&period;
| xref:absl/InlinedVector/const_iterator.adoc[`const&lowbar;iterator`] 
| A const iterator over the elements&period;
| xref:absl/InlinedVector/const_pointer.adoc[`const&lowbar;pointer`] 
| A pointer to a const element&period;
| xref:absl/InlinedVector/const_reference.adoc[`const&lowbar;reference`] 
| A reference to a const element&period;
| xref:absl/InlinedVector/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| A const reverse iterator over the elements&period;
| xref:absl/InlinedVector/difference_type.adoc[`difference&lowbar;type`] 
| A signed integral type used for differences between iterators&period;
| xref:absl/InlinedVector/iterator.adoc[`iterator`] 
| An iterator over the elements&period;
| xref:absl/InlinedVector/pointer.adoc[`pointer`] 
| A pointer to an element&period;
| xref:absl/InlinedVector/reference.adoc[`reference`] 
| A reference to an element&period;
| xref:absl/InlinedVector/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| A reverse iterator over the elements&period;
| xref:absl/InlinedVector/size_type.adoc[`size&lowbar;type`] 
| An unsigned integral type used for sizes&period;
| xref:absl/InlinedVector/value_type.adoc[`value&lowbar;type`] 
| The type of the elements stored in the inlined vector&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/InlinedVector/2constructor-05.adoc[`InlinedVector`]         [.small]#[constructor]#
| Constructors
| xref:absl/InlinedVector/2destructor.adoc[`&#126;InlinedVector`] [.small]#[destructor]#
| Destroys the inlined vector and its elements&period;
| xref:absl/InlinedVector/operator_assign-0f.adoc[`operator&equals;`] 
| Assignment operators
| xref:absl/InlinedVector/assign-06.adoc[`assign`] 
| `assign` overloads
| xref:absl/InlinedVector/at-0f.adoc[`at`] 
| `at` overloads
| xref:absl/InlinedVector/back-00.adoc[`back`] 
| `back` overloads
| xref:absl/InlinedVector/begin-0be.adoc[`begin`] 
| `begin` overloads
| xref:absl/InlinedVector/capacity.adoc[`capacity`] 
| Returns the number of elements that could be stored in the inlined vector without requiring a reallocation&period;
| xref:absl/InlinedVector/cbegin.adoc[`cbegin`] 
| Returns a `const&lowbar;iterator` to the beginning of the inlined vector&period;
| xref:absl/InlinedVector/cend.adoc[`cend`] 
| Returns a `const&lowbar;iterator` to the end of the inlined vector&period;
| xref:absl/InlinedVector/clear.adoc[`clear`] 
| Destroys all elements in the inlined vector, setting the size to `0` and preserving capacity&period;
| xref:absl/InlinedVector/crbegin.adoc[`crbegin`] 
| Returns a `const&lowbar;reverse&lowbar;iterator` from the end of the inlined vector&period;
| xref:absl/InlinedVector/crend.adoc[`crend`] 
| Returns a `const&lowbar;reverse&lowbar;iterator` from the beginning of the inlined vector&period;
| xref:absl/InlinedVector/data-03.adoc[`data`] 
| `data` overloads
| xref:absl/InlinedVector/emplace.adoc[`emplace`] 
| Constructs and inserts an element using `args&period;&period;&period;` in the inlined vector at `pos`, returning an `iterator` pointing to the newly emplaced element&period;
| xref:absl/InlinedVector/emplace_back.adoc[`emplace&lowbar;back`] 
| Constructs and inserts an element using `args&period;&period;&period;` in the inlined vector at `end()`, returning a `reference` to the newly emplaced element&period;
| xref:absl/InlinedVector/empty.adoc[`empty`] 
| Returns whether the inlined vector contains no elements&period;
| xref:absl/InlinedVector/end-00.adoc[`end`] 
| `end` overloads
| xref:absl/InlinedVector/erase-00.adoc[`erase`] 
| `erase` overloads
| xref:absl/InlinedVector/front-03.adoc[`front`] 
| `front` overloads
| xref:absl/InlinedVector/get_allocator.adoc[`get&lowbar;allocator`] 
| Returns a copy of the inlined vector&apos;s allocator&period;
| xref:absl/InlinedVector/insert-08.adoc[`insert`] 
| `insert` overloads
| xref:absl/InlinedVector/max_size.adoc[`max&lowbar;size`] 
| Returns the maximum number of elements the inlined vector can hold&period;
| xref:absl/InlinedVector/operator_subs-02.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:absl/InlinedVector/pop_back.adoc[`pop&lowbar;back`] 
| Destroys the element at `back()`, reducing the size by `1`&period;
| xref:absl/InlinedVector/push_back-03.adoc[`push&lowbar;back`] 
| `push&lowbar;back` overloads
| xref:absl/InlinedVector/rbegin-07.adoc[`rbegin`] 
| `rbegin` overloads
| xref:absl/InlinedVector/rend-01.adoc[`rend`] 
| `rend` overloads
| xref:absl/InlinedVector/reserve.adoc[`reserve`] 
| Ensures that there is enough room for at least `n` elements&period;
| xref:absl/InlinedVector/resize-08.adoc[`resize`] 
| `resize` overloads
| xref:absl/InlinedVector/shrink_to_fit.adoc[`shrink&lowbar;to&lowbar;fit`] 
| Attempts to reduce memory usage by moving elements to (or keeping elements in) the smallest available buffer sufficient for containing `size()` elements&period;
| xref:absl/InlinedVector/size.adoc[`size`] 
| Returns the number of elements in the inlined vector&period;
| xref:absl/InlinedVector/swap.adoc[`swap`] 
| Swaps the contents of the inlined vector with `other`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:absl/AbslHashValue-06.adoc[absl::AbslHashValue]`
| Provides `absl&colon;&colon;Hash` support for `absl&colon;&colon;InlinedVector`&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/erase_if-049.adoc[`erase&lowbar;if`]
| Erases all elements that satisfy the predicate `pred` from the inlined vector `v`&period;
| xref:absl/operator_not_eq-053e.adoc[`operator!&equals;`]
| Tests for value&hyphen;inequality of two inlined vectors&period;
| xref:absl/operator_lt-0b.adoc[`operator&lt;`]
| Tests whether the value of an inlined vector is less than the value of another inlined vector using a lexicographical comparison algorithm&period;
| xref:absl/operator_le-00e1.adoc[`operator&lt;&equals;`]
| Tests whether the value of an inlined vector is less than or equal to the value of another inlined vector using a lexicographical comparison algorithm&period;
| xref:absl/operator_eq-0df.adoc[`operator&equals;&equals;`]
| Tests for value&hyphen;equality of two inlined vectors&period;
| xref:absl/operator_gt-07.adoc[`operator&gt;`]
| Tests whether the value of an inlined vector is greater than the value of another inlined vector using a lexicographical comparison algorithm&period;
| xref:absl/operator_ge-041.adoc[`operator&gt;&equals;`]
| Tests whether the value of an inlined vector is greater than or equal to the value of another inlined vector using a lexicographical comparison algorithm&period;
| xref:absl/swap-0a.adoc[`swap`]
| Swaps the contents of two inlined vectors&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
