absl::Status::Status

Constructors

Synopses

Declared in <absl/status/status.h>

Creates an OK status with no message or payload.

Status();
» more...

Copy constructor.

Status(Status const& x);
» more...

Move constructor. The moved-from state is valid but unspecified.

Status(Status&& x) noexcept;
» more...

Creates a status from a base_status and a loc.

Status(
    Status const& base_status,
    absl::SourceLocation loc);
» more...

Creates a status by moving from base_status and appending loc.

Status(
    Status&& base_status,
    absl::SourceLocation loc);
» more...

Creates a status in the canonical error space with the specified absl::StatusCode and error message. If code == absl::StatusCode::kOk, msg is ignored and an object identical to an OK status is constructed.

Status(
    absl::StatusCode code,
    std::string_view msg,
    absl::SourceLocation loc = SourceLocation::current());
» more...

Same as above but for rvalue string.

template<
    typename String,
    typename = /* implementation-defined */::EnableIfString<String>>
Status(
    absl::StatusCode code,
    String&& msg,
    absl::SourceLocation loc = SourceLocation::current());
» more...

Parameters

NameDescription
xThe status to copy from.
base_statusThe status to copy.
locThe source location to append to the location chain.
codeThe canonical error code for the status.
msgThe UTF-8 error message.