[#util-Result-value_or-05]
= xref:util.adoc[util]::xref:util/Result.adoc[Result]::value&lowbar;or
:relfileprefix: ../../
:mrdocs:

Returns the held value, or a fallback when the result holds an error&period;

== Synopsis

Declared in `&lt;util&sol;result&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
xref:util/Result.adoc[T]
value&lowbar;or(U&& default&lowbar;value) const &amp;;
----

== Return Value

the stored value if present, otherwise default&lowbar;value

== Parameters

[cols="1,4"]
|===
| Name| Description
| *default&lowbar;value*
| the value returned when no value is held
|===


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