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

A run&hyphen;time fixed&hyphen;size array that allocates small arrays inline&period;

== Synopsis

Declared in `&lt;absl&sol;container&sol;fixed&lowbar;array&period;h&gt;`

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

== Description

A `FixedArray` provides a run&hyphen;time fixed&hyphen;size array, allocating a small array inline for efficiency&period;

Most users should not specify the `N` template parameter and let `FixedArray` automatically determine the number of elements to store inline based on `sizeof(T)`&period; If `N` is specified, the `FixedArray` implementation will use inline storage for arrays with a length &lt;&equals; `N`&period;

Note that a `FixedArray` constructed with a `size&lowbar;type` argument will default&hyphen;initialize its values by leaving trivially constructible types uninitialized (e&period;g&period; int, int&lsqb;4&rsqb;, double), and others default&hyphen;constructed&period; This matches the behavior of c&hyphen;style arrays and `std&colon;&colon;array`, but not `std&colon;&colon;vector`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:absl/FixedArray/allocator_type.adoc[`allocator&lowbar;type`] 
| The allocator type used to allocate and construct elements&period;
| xref:absl/FixedArray/const_iterator.adoc[`const&lowbar;iterator`] 
| A random&hyphen;access iterator over const elements&period;
| xref:absl/FixedArray/const_pointer.adoc[`const&lowbar;pointer`] 
| A pointer to a const element&period;
| xref:absl/FixedArray/const_reference.adoc[`const&lowbar;reference`] 
| A reference to a const element&period;
| xref:absl/FixedArray/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| A reverse iterator over const elements&period;
| xref:absl/FixedArray/difference_type.adoc[`difference&lowbar;type`] 
| A signed integral type used for iterator differences&period;
| xref:absl/FixedArray/iterator.adoc[`iterator`] 
| A random&hyphen;access iterator over the elements&period;
| xref:absl/FixedArray/pointer.adoc[`pointer`] 
| A pointer to an element&period;
| xref:absl/FixedArray/reference.adoc[`reference`] 
| A reference to an element&period;
| xref:absl/FixedArray/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| A reverse iterator over the elements&period;
| xref:absl/FixedArray/size_type.adoc[`size&lowbar;type`] 
| An unsigned integral type used for sizes and indices&period;
| xref:absl/FixedArray/value_type.adoc[`value&lowbar;type`] 
| The type of the elements stored in the fixed array&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/FixedArray/2constructor-08b.adoc[`FixedArray`]         [.small]#[constructor]#
| Constructors
| xref:absl/FixedArray/2destructor.adoc[`&#126;FixedArray`] [.small]#[destructor]#
| Destroys the fixed array and its elements&period;
| xref:absl/FixedArray/operator_assign-06.adoc[`operator&equals;`] 
| Assignment operators
| xref:absl/FixedArray/at-08.adoc[`at`] 
| `at` overloads
| xref:absl/FixedArray/back-07.adoc[`back`] 
| `back` overloads
| xref:absl/FixedArray/begin-067.adoc[`begin`] 
| `begin` overloads
| xref:absl/FixedArray/cbegin.adoc[`cbegin`] 
| Returns a const iterator to the beginning of the fixed array&period;
| xref:absl/FixedArray/cend.adoc[`cend`] 
| Returns a const iterator to the end of the fixed array&period;
| xref:absl/FixedArray/crbegin.adoc[`crbegin`] 
| Returns a const reverse iterator from the end of the fixed array&period;
| xref:absl/FixedArray/crend.adoc[`crend`] 
| Returns a const reverse iterator from the beginning of the fixed array&period;
| xref:absl/FixedArray/data-0d.adoc[`data`] 
| `data` overloads
| xref:absl/FixedArray/empty.adoc[`empty`] 
| Returns whether or not the fixed array is empty&period;
| xref:absl/FixedArray/end-07.adoc[`end`] 
| `end` overloads
| xref:absl/FixedArray/fill.adoc[`fill`] 
| Assigns the given `value` to all elements in the fixed array&period;
| xref:absl/FixedArray/front-00.adoc[`front`] 
| `front` overloads
| xref:absl/FixedArray/max_size.adoc[`max&lowbar;size`] 
| Returns the largest possible value of `std&colon;&colon;distance(begin(), end())` for a `FixedArray&lt;T&gt;`&period; This is equivalent to the most possible addressable bytes over the number of bytes taken by T&period;
| xref:absl/FixedArray/memsize.adoc[`memsize`] 
| Returns the memory size of the fixed array in bytes&period;
| xref:absl/FixedArray/operator_subs-01.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:absl/FixedArray/rbegin-07.adoc[`rbegin`] 
| `rbegin` overloads
| xref:absl/FixedArray/rend-0d.adoc[`rend`] 
| `rend` overloads
| xref:absl/FixedArray/size.adoc[`size`] 
| Returns the length of the fixed array&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:absl/FixedArray/inline_elements.adoc[`inline&lowbar;elements`] 
| The number of elements stored inline before heap allocation is used&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:absl/AbslHashValue-0c5.adoc[absl::AbslHashValue]`
| Combines the contents of the fixed array into a hash state&period;
| `xref:absl/operator_ge-0a9.adoc[absl::operator&gt;&equals;]`
| Returns whether `lhs` orders lexicographically after or equal to `rhs`&period;
| `xref:absl/operator_le-097.adoc[absl::operator&lt;&equals;]`
| Returns whether `lhs` orders lexicographically before or equal to `rhs`&period;
| `xref:absl/operator_gt-0ce.adoc[absl::operator&gt;]`
| Returns whether `lhs` orders lexicographically after `rhs`&period;
| `xref:absl/operator_lt-0ef.adoc[absl::operator&lt;]`
| Returns whether `lhs` orders lexicographically before `rhs`&period;
| `xref:absl/operator_not_eq-0ca.adoc[absl::operator!&equals;]`
| Returns whether two fixed arrays are not elementwise equal&period;
| `xref:absl/operator_eq-0c2.adoc[absl::operator&equals;&equals;]`
| Returns whether two fixed arrays are elementwise equal&period;
|===


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