[#absl-StatusBuilder-SetErrorCode-04]
= xref:absl.adoc[absl]::xref:absl/StatusBuilder.adoc[StatusBuilder]::SetErrorCode
:relfileprefix: ../../
:mrdocs:

Sets a non&hyphen;canonical error code on the result status&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Enum&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
decltype(std&colon;&colon;move(SetErrorCode(code)))
SetErrorCode(Enum code) &amp;&amp;;
----

== Description

As above, but &amp;&amp;&hyphen;qualified&period; Uses `decltype()` to propagate template constraints (SFINAE)&period;

== Return Value

`&ast;this` to allow method chaining&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *code*
| The error code to set&period;
|===


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