[#BloombergLP-bdlc-CompactedArray] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::CompactedArray :relfileprefix: ../../ :mrdocs: Space‐efficient value‐semantic array of `TYPE` elements. == Synopsis Declared in `<bdlc_compactedarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class CompactedArray; ---- == Description This space‐efficient, value‐semantic array class represents a sequence of `TYPE` elements. The interface provides functionality similar to a `vector<TYPE>`, however, modifiable references to individual elements are not provided. This class provides accessors that return iterators that provide non‐modifiable access to its elements. The returned iterators, unlike those returned by a `vector<TYPE>`, are _not_ invalidated upon reallocation. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/CompactedArray/const_iterator.adoc[`const_iterator`] | Const iterator over elements of this array. | xref:BloombergLP/bdlc/CompactedArray/value_type.adoc[`value_type`] | Element type stored by this array. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/CompactedArray/2constructor-0a.adoc[`CompactedArray`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlc/CompactedArray/2destructor.adoc[`~CompactedArray`] [.small]#[destructor]# | Destroy this object | xref:BloombergLP/bdlc/CompactedArray/operator_assign.adoc[`operator=`] | Assign to this array the value of the specified `rhs` array, and return a reference providing modifiable access to this array. | xref:BloombergLP/bdlc/CompactedArray/allocator.adoc[`allocator`] | Return the allocator used by this array to supply memory. | xref:BloombergLP/bdlc/CompactedArray/append-08.adoc[`append`] | `append` overloads | xref:BloombergLP/bdlc/CompactedArray/back.adoc[`back`] | Return a const reference to the element at the back of this array. | xref:BloombergLP/bdlc/CompactedArray/begin.adoc[`begin`] | Return an iterator referring to the first element in this array. | xref:BloombergLP/bdlc/CompactedArray/capacity.adoc[`capacity`] | Return the number of elements this array can hold, without reallocation, assuming the number of unique elements within this array does not increase. | xref:BloombergLP/bdlc/CompactedArray/end.adoc[`end`] | Return the past‐the‐end iterator for this array. The iterator remains valid as long as this array exists, and its length does not decrease. | xref:BloombergLP/bdlc/CompactedArray/front.adoc[`front`] | Return a const reference to the element at the front of this array. | xref:BloombergLP/bdlc/CompactedArray/insert-03d.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdlc/CompactedArray/isEmpty.adoc[`isEmpty`] | Return `true` if there are no elements in this array, and `false` otherwise. | xref:BloombergLP/bdlc/CompactedArray/isEqual.adoc[`isEqual`] | Return `true` if this and the specified `other` array have the same value. | xref:BloombergLP/bdlc/CompactedArray/length.adoc[`length`] | Return the number of elements in this array. | xref:BloombergLP/bdlc/CompactedArray/operator_subs.adoc[`operator[]`] | Return a const reference to the element at `index`. | xref:BloombergLP/bdlc/CompactedArray/pop_back.adoc[`pop_back`] | Remove the last element from this array. The behavior is undefined unless `0 < length()`. | xref:BloombergLP/bdlc/CompactedArray/print.adoc[`print`] | Write the value of this array to the specified output `stream`. | xref:BloombergLP/bdlc/CompactedArray/push_back.adoc[`push_back`] | Append to this array an element having the specified `value`. | xref:BloombergLP/bdlc/CompactedArray/remove-00.adoc[`remove`] | `remove` overloads | xref:BloombergLP/bdlc/CompactedArray/removeAll.adoc[`removeAll`] | Remove all the elements from this array. | xref:BloombergLP/bdlc/CompactedArray/replace-0c.adoc[`replace`] | `replace` overloads | xref:BloombergLP/bdlc/CompactedArray/reserveCapacity-08.adoc[`reserveCapacity`] | Make the capacity of this array at least the specified `numElements`. | xref:BloombergLP/bdlc/CompactedArray/resize.adoc[`resize`] | Set the length of this array to the specified `numElements`. | xref:BloombergLP/bdlc/CompactedArray/swap.adoc[`swap`] | Efficiently exchange the value of this array with that of `other`. | xref:BloombergLP/bdlc/CompactedArray/uniqueElement.adoc[`uniqueElement`] | Return a const reference to the unique element at the specified `index`. | xref:BloombergLP/bdlc/CompactedArray/uniqueLength.adoc[`uniqueLength`] | Return the number of unique elements in this array. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/operator_not_eq-0b4.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` arrays do not have the same value, and `false` otherwise. | xref:BloombergLP/bdlc/operator_eq-085.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` arrays have the same value, and `false` otherwise. | xref:BloombergLP/bdlc/swap-03.adoc[`swap`] | Exchange the values of the specified `a` and `b` objects. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#