[#absl-Status-2constructor-08b]
= xref:absl.adoc[absl]::xref:absl/Status.adoc[Status]::Status
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Creates an OK status with no message or payload&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-08e.adoc[Status]();
----

[.small]#xref:absl/Status/2constructor-08e.adoc[_» more&period;&period;&period;_]#

Copy constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-03.adoc[Status](xref:absl/Status.adoc[Status] const& x);
----

[.small]#xref:absl/Status/2constructor-03.adoc[_» more&period;&period;&period;_]#

Move constructor&period; The moved&hyphen;from state is valid but unspecified&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-0e.adoc[Status](xref:absl/Status.adoc[Status]&& x) noexcept;
----

[.small]#xref:absl/Status/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Creates a status from a `base&lowbar;status` and a `loc`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-07.adoc[Status](
    xref:absl/Status.adoc[Status] const& base&lowbar;status,
    xref:absl/SourceLocation.adoc[absl::SourceLocation] loc);
----

[.small]#xref:absl/Status/2constructor-07.adoc[_» more&period;&period;&period;_]#

Creates a status by moving from `base&lowbar;status` and appending `loc`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-0f.adoc[Status](
    xref:absl/Status.adoc[Status]&& base&lowbar;status,
    xref:absl/SourceLocation.adoc[absl::SourceLocation] loc);
----

[.small]#xref:absl/Status/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Creates a status in the canonical error space with the specified `absl&colon;&colon;StatusCode` and error message&period; If `code &equals;&equals; absl&colon;&colon;StatusCode&colon;&colon;kOk`, `msg` is ignored and an object identical to an OK status is constructed&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status/2constructor-00.adoc[Status](
    xref:absl/StatusCode.adoc[absl::StatusCode] code,
    std::string&lowbar;view msg,
    xref:absl/SourceLocation.adoc[absl::SourceLocation] loc = SourceLocation&colon;&colon;current());
----

[.small]#xref:absl/Status/2constructor-00.adoc[_» more&period;&period;&period;_]#

Same as above but for rvalue string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename String,
    typename = &sol;&ast; implementation-defined &ast;&sol;::EnableIfString&lt;String&gt;&gt;
xref:absl/Status/2constructor-0a.adoc[Status](
    xref:absl/StatusCode.adoc[absl::StatusCode] code,
    String&& msg,
    xref:absl/SourceLocation.adoc[absl::SourceLocation] loc = SourceLocation&colon;&colon;current());
----

[.small]#xref:absl/Status/2constructor-0a.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| The status to copy from&period;
| *base&lowbar;status*
| The status to copy&period;
| *loc*
| The source location to append to the location chain&period;
| *code*
| The canonical error code for the status&period;
| *msg*
| The UTF&hyphen;8 error message&period;
|===


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