[#BloombergLP-bdlat_ArrayFunctions] = xref:BloombergLP.adoc[BloombergLP]::bdlat_ArrayFunctions :relfileprefix: ../ :mrdocs: This `namespace` provides functions that expose "array" behavior for "array" types. Specializations are provided for `bsl::vector<TYPE>`. See the component‐level documentation for more information. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlat_ArrayFunctions/ElementType-0d.adoc[`ElementType`] | This meta‐function should contain a typedef `Type` that specifies the type of element stored in an array of the parameterized `TYPE`. | xref:BloombergLP/bdlat_ArrayFunctions/IsArray-09.adoc[`IsArray`] | This `struct` should be specialized for third‐party types that are need to expose "array" behavior. See the component‐level documentation for further information. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlat_ArrayFunctions/accessElement.adoc[`accessElement`] | Invoke the specified `accessor` on the non‐modifiable element at the specified `index` of the specified `array`. The supplied `accessor` must be a callable type that can be called as if it had the following signature: ` int accessor(const ELEMENT_TYPE& element); ` Return the value from the invocation of `accessor`. The behavior is undefined unless `0 <= index` and `index < size(array)`. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arrayAccessElement.adoc[`bdlat_arrayAccessElement`] | Invoke the specified `accessor` on the element at the specified `index` of the specified `array`. Return the value from the invocation of `accessor`. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arrayManipulateElement.adoc[`bdlat_arrayManipulateElement`] | Apply the specified `manipulator` to the element at the specified `index` in the specified `array`. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arrayReserve-02.adoc[`bdlat_arrayReserve`] | Reserve capacity for the specified `array` to hold at least the specified `numElements` elements. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arrayResize.adoc[`bdlat_arrayResize`] | Resize the specified `array` to contain the specified `newSize` elements. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arraySize.adoc[`bdlat_arraySize`] | Return the number of elements in the specified `array`. | xref:BloombergLP/bdlat_ArrayFunctions/bdlat_arraySupportsReserve-07.adoc[`bdlat_arraySupportsReserve`] | `bdlat_arraySupportsReserve` overloads | xref:BloombergLP/bdlat_ArrayFunctions/manipulateElement.adoc[`manipulateElement`] | ` Return the value from the invocation of `manipulator`. The behavior is undefined unless `0 <= index` and `index < size(*array)`. | xref:BloombergLP/bdlat_ArrayFunctions/reserve.adoc[`reserve`] | If successful, make the capacity of the specified modifiable `array` at least the specified `numElements` and return zero. If unsuccessful or unsupported, return a non‐zero value. This method has no effect, and returns zero, if the current capacity meets or exceeds the required capacity. The behavior is undefined unless `0 <= numElements`. | xref:BloombergLP/bdlat_ArrayFunctions/resize.adoc[`resize`] | Set the size of the specified modifiable `array` to the specified `newSize`. If `newSize > size(array)`, then `newSize ‐ size(array)` elements with default values are appended to `array`. If `newSize < size(array)`, then the `size(array) ‐ newSize` elements at the end of `array` are destroyed. The behavior is undefined unless `0 <= newSize`. | xref:BloombergLP/bdlat_ArrayFunctions/size.adoc[`size`] | Return the number of elements in the specified `array`. | xref:BloombergLP/bdlat_ArrayFunctions/supportsReserve.adoc[`supportsReserve`] | Return `true` if `reserve` will attempt to reserve capacity in the specified `array`, and `false` otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#