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

Name

Description

ElementType

This meta‐function should contain a typedef Type that specifies the type of element stored in an array of the parameterized TYPE.

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

Name

Description

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).

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.

bdlat_arrayManipulateElement

Apply the specified manipulator to the element at the specified index in the specified array.

bdlat_arrayReserve

Reserve capacity for the specified array to hold at least the specified numElements elements.

bdlat_arrayResize

Resize the specified array to contain the specified newSize elements.

bdlat_arraySize

Return the number of elements in the specified array.

bdlat_arraySupportsReserve

bdlat_arraySupportsReserve overloads

manipulateElement

` Return the value from the invocation of manipulator. The behavior is undefined unless 0 <= index and index < size(*array).

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.

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.

size

Return the number of elements in the specified array.

supportsReserve

Return true if reserve will attempt to reserve capacity in the specified array, and false otherwise.

Created with MrDocs