[#BloombergLP-bdlc-PackedIntArray-0b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::PackedIntArray
:relfileprefix: ../../
:mrdocs:

Space&hyphen;efficient value&hyphen;semantic array of packed `TYPE` integers&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class PackedIntArray;
----

== Description

This space&hyphen;efficient value&hyphen;semantic array class represents a sequence of `TYPE` elements&semi; `TYPE` 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; This class provides accessors that return iterators that provide non&hyphen;modifiable access to its elements&period; The returned iterators, unlike those returned by a `vector&lt;int&gt;` are _not_ invalidated upon reallocation&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArray-0b/const_iterator.adoc[`const&lowbar;iterator`] 
| Constant iterator type for this packed array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/value_type.adoc[`value&lowbar;type`] 
| Element value type for this packed array&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArray-0b/2constructor-02.adoc[`PackedIntArray`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlc/PackedIntArray-0b/2destructor.adoc[`&#126;PackedIntArray`] [.small]#[destructor]#
| Destroy this object
| xref:BloombergLP/bdlc/PackedIntArray-0b/operator_assign.adoc[`operator&equals;`] 
| Assign to this array the value of the specified `rhs` array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/allocator.adoc[`allocator`] 
| Return the allocator used by this array to supply memory&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/append-0c.adoc[`append`] 
| `append` overloads
| xref:BloombergLP/bdlc/PackedIntArray-0b/back.adoc[`back`] 
| Return the value of the element at the back of this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/bdexStreamIn.adoc[`bdexStreamIn`] 
| Assign to this object the value read from the specified input stream&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/bdexStreamOut.adoc[`bdexStreamOut`] 
| Write this value to the specified output `stream`&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/begin.adoc[`begin`] 
| Return an iterator to the first element (or `end()` if empty)&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/bytesPerElement.adoc[`bytesPerElement`] 
| Return the number of bytes currently used to store each element in this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/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/PackedIntArray-0b/end.adoc[`end`] 
| Return an iterator one past the last element in this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/front.adoc[`front`] 
| Return the value of the element at the front of this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0ae.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdlc/PackedIntArray-0b/isEmpty.adoc[`isEmpty`] 
| Return `true` if there are no elements in this array, and `false` otherwise&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/isEqual.adoc[`isEqual`] 
| Return `true` if this and `other` have the same value&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/length.adoc[`length`] 
| Return number of elements in this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Return the value of the element at the specified `index`&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/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/PackedIntArray-0b/print.adoc[`print`] 
| Write the value of this array to the specified output `stream`&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/push_back.adoc[`push&lowbar;back`] 
| Append an element having the specified `value` to this array&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/remove-02.adoc[`remove`] 
| `remove` overloads
| xref:BloombergLP/bdlc/PackedIntArray-0b/removeAll.adoc[`removeAll`] 
| Remove all the elements from this array and set the storage required per element to one byte&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/replace-05.adoc[`replace`] 
| `replace` overloads
| xref:BloombergLP/bdlc/PackedIntArray-0b/reserveCapacity-03.adoc[`reserveCapacity`] 
| `reserveCapacity` overloads
| xref:BloombergLP/bdlc/PackedIntArray-0b/resize.adoc[`resize`] 
| Set the length of this array to the specified `numElements`&period;
| xref:BloombergLP/bdlc/PackedIntArray-0b/swap.adoc[`swap`] 
| Efficiently exchange the value of this array with that of `other`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/PackedIntArray-0b/maxSupportedBdexVersion.adoc[`maxSupportedBdexVersion`] 
| Return the BDEX version for the given `serializationVersion`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/operator_not_eq-07.adoc[`operator!&equals;`]
| Return `true` if `lhs` and `rhs` do not have the same value&period;
| xref:BloombergLP/bdlc/operator_eq-080.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value&period;
| xref:BloombergLP/bdlc/swap-01.adoc[`swap`]
| Exchange the values of the specified `a` and `b` objects&period;
|===


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