[#absl-optional_ref-0c-value_or]
= xref:absl.adoc[absl]::xref:absl/optional_ref-0c.adoc[optional&lowbar;ref]::value&lowbar;or
:relfileprefix: ../../
:mrdocs:

Returns the value if present, otherwise `default&lowbar;value`&period;

== Synopsis

Declared in `&lt;absl&sol;types&sol;optional&lowbar;ref&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U&gt;
constexpr
T
value&lowbar;or(U&& default&lowbar;value) const;
----

== Return Value

The referenced value, or `default&lowbar;value` if empty&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *default&lowbar;value*
| The value returned when `&ast;this` is empty&period;
|===


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