[#absl-StatusOr-operator_assign-0b]
= xref:absl.adoc[absl]::xref:absl/StatusOr.adoc[StatusOr]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Assignment operators

== Synopses

Declared in `&lt;absl&sol;status&sol;statusor&period;h&gt;`

Copy assignment operator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-043.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr] const& other) = default;
----

[.small]#xref:absl/StatusOr/operator_assign-043.adoc[_» more&period;&period;&period;_]#

Converting assignment operator from an `absl&colon;&colon;StatusOr&lt;U&gt;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U&gt;
requires internal&lowbar;statusor&colon;&colon;IsStatusOrAssignmentValid&lt;
                                  T, const U&amp;, false&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-08.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr&lt;U&gt;] const& other);
----

[.small]#xref:absl/StatusOr/operator_assign-08.adoc[_» more&period;&period;&period;_]#

Converting assignment operator from an `absl&colon;&colon;StatusOr&lt;U&gt;` (lifetime&hyphen;bound)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U&gt;
requires internal&lowbar;statusor&colon;&colon;IsStatusOrAssignmentValid&lt;
                                  T, const U&amp;, true&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-0e.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr&lt;U&gt;] const& other);
----

[.small]#xref:absl/StatusOr/operator_assign-0e.adoc[_» more&period;&period;&period;_]#

Move assignment operator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-09.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr]&& other) = default;
----

[.small]#xref:absl/StatusOr/operator_assign-09.adoc[_» more&period;&period;&period;_]#

Converting move assignment operator from an `absl&colon;&colon;StatusOr&lt;U&gt;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U&gt;
requires internal&lowbar;statusor&colon;&colon;IsStatusOrAssignmentValid&lt;
                                  T, U&amp;&amp;, false&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-047.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr&lt;U&gt;]&& other);
----

[.small]#xref:absl/StatusOr/operator_assign-047.adoc[_» more&period;&period;&period;_]#

Converting move assignment operator from an `absl&colon;&colon;StatusOr&lt;U&gt;` (lifetime&hyphen;bound)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U&gt;
requires internal&lowbar;statusor&colon;&colon;IsStatusOrAssignmentValid&lt;
                                  T, U&amp;&amp;, true&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-06.adoc[operator&equals;](xref:absl/StatusOr.adoc[StatusOr&lt;U&gt;]&& other);
----

[.small]#xref:absl/StatusOr/operator_assign-06.adoc[_» more&period;&period;&period;_]#

Assigns a value convertible to `Status`, making `&ast;this` non&hyphen;ok&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U = xref:absl/Status.adoc[absl::Status]&gt;
requires internal&lowbar;statusor&colon;&colon;IsConstructionFromStatusValid&lt;
                                  false, T, U&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-07.adoc[operator&equals;](U&& v);
----

[.small]#xref:absl/StatusOr/operator_assign-07.adoc[_» more&period;&period;&period;_]#

Perfect&hyphen;forwarding value assignment operator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U = T&gt;
requires internal&lowbar;statusor&colon;&colon;IsAssignmentValid&lt;T, U, false&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-01.adoc[operator&equals;](U&& v);
----

[.small]#xref:absl/StatusOr/operator_assign-01.adoc[_» more&period;&period;&period;_]#

Perfect&hyphen;forwarding value assignment operator (captured&hyphen;by&hyphen;this overload)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename U = T&gt;
requires internal&lowbar;statusor&colon;&colon;IsAssignmentValid&lt;T, U, true&gt;&colon;&colon;value
xref:absl/StatusOr.adoc[StatusOr]&
xref:absl/StatusOr/operator_assign-0c.adoc[operator&equals;](U&& v);
----

[.small]#xref:absl/StatusOr/operator_assign-0c.adoc[_» more&period;&period;&period;_]#

== Return Value

A reference to `&ast;this`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| The source object&period;
| *v*
| The status (or value convertible to a status) to store&period;
|===


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