Invoke the specified accessor on the non‐modifiable element at the specified index of the specified array.

Synopsis

Declared in <bdlat_arrayfunctions.h>

template<
    class TYPE,
    class ACCESSOR>
int
accessElement(
    TYPE const& array,
    ACCESSOR& accessor,
    int index);

Description

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

Return Value

result of invoking accessor

Parameters

Name

Description

array

array whose element is accessed

accessor

functor applied to the element at index

index

position of the element to access

Created with MrDocs