A run‐time fixed‐size array that allocates small arrays inline.
Synopsis
Declared in <absl/container/fixed_array.h>
template<
typename T,
size_t N = kFixedArrayUseDefault,
typename A = std::allocator<T>>
class FixedArray;
Description
A FixedArray provides a run‐time fixed‐size array, allocating a small array inline for efficiency.
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). If N is specified, the FixedArray implementation will use inline storage for arrays with a length <= N.
Note that a FixedArray constructed with a size_type argument will default‐initialize its values by leaving trivially constructible types uninitialized (e.g. int, int[4], double), and others default‐constructed. This matches the behavior of c‐style arrays and std::array, but not std::vector.
Type Aliases
Name |
Description |
The allocator type used to allocate and construct elements. |
|
A random‐access iterator over const elements. |
|
A pointer to a const element. |
|
A reference to a const element. |
|
A reverse iterator over const elements. |
|
A signed integral type used for iterator differences. |
|
A random‐access iterator over the elements. |
|
A pointer to an element. |
|
A reference to an element. |
|
A reverse iterator over the elements. |
|
An unsigned integral type used for sizes and indices. |
|
The type of the elements stored in the fixed array. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroys the fixed array and its elements. |
Assignment operators |
|
|
|
|
|
|
|
Returns a const iterator to the beginning of the fixed array. |
|
Returns a const iterator to the end of the fixed array. |
|
Returns a const reverse iterator from the end of the fixed array. |
|
Returns a const reverse iterator from the beginning of the fixed array. |
|
|
|
Returns whether or not the fixed array is empty. |
|
|
|
Assigns the given |
|
|
|
Returns the largest possible value of |
|
Returns the memory size of the fixed array in bytes. |
|
Subscript operators |
|
|
|
|
|
Returns the length of the fixed array. |
Static Data Members
Name |
Description |
The number of elements stored inline before heap allocation is used. |
Friends
Name |
Description |
Combines the contents of the fixed array into a hash state. |
|
Returns whether |
|
Returns whether |
|
Returns whether |
|
Returns whether |
|
Returns whether two fixed arrays are not elementwise equal. |
|
Returns whether two fixed arrays are elementwise equal. |
Created with MrDocs