[#BloombergLP-bdlat-ArrayUtil-accessElementByCategory] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlat.adoc[bdlat]::xref:BloombergLP/bdlat/ArrayUtil.adoc[ArrayUtil]::accessElementByCategory :relfileprefix: ../../../ :mrdocs: Invoke a categorized accessor on an element of the specified array. == Synopsis Declared in `<bdlat_arrayutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class ACCESSOR> static int accessElementByCategory( TYPE const& array, ACCESSOR& accessor, int index); ---- == Description Invoke the specified `accessor` on the non‐modifiable element at the specified `index` of the specified `array` and on a prvalue of the category tag type for the dynamic category of the element. See {`bdlat_typecategory`|Category Tags and Enumerators} for documentation about category tags. Return the value from the invocation of `accessor`. The accessor must be an accessor functor. See {`bdlat_typecategory`|`ACCESSOR` Functors} for the requirements on `accessor`. The behavior is undefined unless `0 <= index < bdlat_ArrayFunctions::size(array)`. == Return Value value from the invocation of `accessor` == Parameters [cols="1,4"] |=== | Name| Description | *array* | array whose element is accessed | *accessor* | functor applied to the element with a category tag | *index* | zero‐based index of the element |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#