[#BloombergLP-bdlat_NullableValueFunctions-accessValue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlat_NullableValueFunctions.adoc[bdlat&lowbar;NullableValueFunctions]::accessValue
:relfileprefix: ../../
:mrdocs:

Invoke the specified `accessor` on the non&hyphen;modifiable value stored in the specified &quot;nullable&quot; `object`&period;

== Synopsis

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

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

== Description

The supplied `accessor` must be a callable type that can be called as if it had the following signature&colon; &grave; int accessor(const VALUE&lowbar;TYPE&amp; value)&semi; &grave; Return the value from the invocation of `accessor`&period; The behavior is undefined unless `object` does not contain a null value&period;

== Return Value

result of invoking `accessor`

== Parameters

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


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