[#BloombergLP-bdlat-NullableValueUtil-accessValueByCategory]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlat.adoc[bdlat]::xref:BloombergLP/bdlat/NullableValueUtil.adoc[NullableValueUtil]::accessValueByCategory
:relfileprefix: ../../../
:mrdocs:

Invoke a categorized accessor on the value held by a nullable object&period;

== Synopsis

Declared in `&lt;bdlat&lowbar;nullablevalueutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class ACCESSOR&gt;
static
int
accessValueByCategory(
    TYPE const& object,
    ACCESSOR& accessor);
----

== Description

Invoke the specified `accessor` on the non&hyphen;modifiable value stored in the specified &quot;nullable&quot; `object` and on a prvalue of the category tag type for the dynamic category of the value&period; See &lcub;`bdlat&lowbar;typecategory`&verbar;Category Tags and Enumerators&rcub; for documentation about category tags&period; Return the value from the invocation of `accessor`&period; The `accessor` must be an accessor functor&period; See &lcub;`bdlat&lowbar;typecategory`&verbar;`ACCESSOR` Functors&rcub; for the requirements on `accessor`&period; The behavior is undefined if `object` contains a null value&period;

== Return Value

value from the invocation of `accessor`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *object*
| &quot;nullable&quot; object whose held value is accessed
| *accessor*
| functor applied to the held value with a category tag
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
