[#BloombergLP-bdlc-PackedIntArrayImp-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/PackedIntArrayImp-0a.adoc[PackedIntArrayImp]&lt;xref:BloombergLP/bdlc/PackedIntArrayImp_Unsigned.adoc[PackedIntArrayImp&lowbar;Unsigned]&gt;
:relfileprefix: ../../
:mrdocs:

This space&hyphen;efficient value&hyphen;semantic array class represents a sequence of `STORAGE&colon;&colon;EightByteStorageType` elements&semi; `STORAGE&colon;&colon;EightByteStorageType` must be convertible to either a signed or unsigned 64&hyphen;bit integer using `static&lowbar;cast`&period; The interface provides functionality similar to a `vector&lt;int&gt;` however references to individual elements are not provided&period;

== Synopsis

Declared in `&lt;bdlc&lowbar;packedintarray&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bdlc/PackedIntArrayImp-0a.adoc[PackedIntArrayImp]&lt;xref:BloombergLP/bdlc/PackedIntArrayImp_Unsigned.adoc[PackedIntArrayImp&lowbar;Unsigned]&gt;;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/ElementType.adoc[`ElementType`] 
| Element storage type used by this packed array implementation&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/2constructor-02.adoc[`PackedIntArrayImp`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/2destructor.adoc[`&#126;PackedIntArrayImp`] [.small]#[destructor]#
| Destroy this object
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/operator_assign.adoc[`operator&equals;`] 
| Assign to this array the value of the specified `rhs` array, and return a reference providing modifiable access to this array&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/allocator.adoc[`allocator`] 
| Return the allocator used by this array to supply memory&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/append-01.adoc[`append`] 
| `append` overloads
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/bdexStreamIn.adoc[`bdexStreamIn`] 
| Assign to this object the value read from the specified input `stream` using the specified `version` format, and return a reference to `stream`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, this object is unaltered and `stream` is invalidated but otherwise unmodified&period; If `version` is supported but `stream` becomes invalid during this operation, this object has an undefined, but valid, state&period; Note that no version is read from `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/bdexStreamOut.adoc[`bdexStreamOut`] 
| Write this value to the specified output `stream` using the specified `version` format, and return a reference to `stream`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, `stream` is invalidated but otherwise unmodified&period; Note that `version` is not written to `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/bytesPerElement.adoc[`bytesPerElement`] 
| Return the number of bytes currently used to store each element in this array&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/capacity.adoc[`capacity`] 
| Return the number of elements this array can hold in terms of the current data type used to store its elements&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/insert-0e.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/isEmpty.adoc[`isEmpty`] 
| Return `true` if there are no elements in this array, and `false` otherwise&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/isEqual.adoc[`isEqual`] 
| Return `true` if this and the specified `other` array have the same value, and `false` otherwise&period; Two `PackedIntArrayImp` arrays have the same value if they have the same length, and all corresponding elements (those at the same indices) have the same value&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/length.adoc[`length`] 
| Return number of elements in this array&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Return the value of the element at the specified `index`&period; The behavior is undefined unless `index &lt; length()`&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/pop_back.adoc[`pop&lowbar;back`] 
| Remove the last element from this array&period; The behavior is undefined unless `0 &lt; length()` &period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/print.adoc[`print`] 
| Write the value of this array to the specified output `stream` in a human&hyphen;readable format, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested arrays&period; If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested arrays&period; If `level` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that the format is not fully specified, and can change without notice&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/push_back.adoc[`push&lowbar;back`] 
| Append an element having the specified `value` to the end of this array&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/remove-02.adoc[`remove`] 
| `remove` overloads
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/removeAll.adoc[`removeAll`] 
| Remove all the elements from this array and set the storage required per element to one byte&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/replace-0a.adoc[`replace`] 
| `replace` overloads
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/reserveCapacity-08.adoc[`reserveCapacity`] 
| `reserveCapacity` overloads
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/reserveCapacityImp.adoc[`reserveCapacityImp`] 
| Make the capacity of this array at least the specified `requiredCapacityInBytes`&period; This method has no effect if the current capacity meets or exceeds the required capacity&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/resize.adoc[`resize`] 
| Set the length of this array to the specified `numElements`&period; If `numElements &gt; length()`, the added elements are initialized to 0&period;
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/swap.adoc[`swap`] 
| Efficiently exchange the value of this array with the value of the specified `other` array&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period; The behavior is undefined unless this array was created with the same allocator as `other`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/maxSupportedBdexVersion.adoc[`maxSupportedBdexVersion`] 
| Return the `version` to be used with the `bdexStreamOut` method corresponding to the specified `serializationVersion`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArrayImp-02/k_MAX_CAPACITY.adoc[`k&lowbar;MAX&lowbar;CAPACITY`] 
| Maximum capacity in bytes for this packed array implementation&period;
|===



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