Invoke the specified accessor on the array element at the specified index.

Synopsis

Declared in <bdlar_arrayref.h>

template<class t_ACCESSOR>
int
accessElement(
    t_ACCESSOR& accessor,
    int index) const;

Description

The supplied accessor must be a callable type that can be called as if it had the following signature: ` int accessor(const ELEMENT& refOrValue); ` Return the value from the invocation of accessor. The behavior is undefined unless 0 <= index < size().

Return Value

value from the invocation of accessor

Parameters

Name

Description

accessor

callable invoked on the element

index

zero‐based index of the element

Created with MrDocs