Constructors

Synopses

Declared in <absl/status/status.h>

Creates an OK status with no message or payload.

Status();

Copy constructor.

Status(Status const& x);

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

Status(Status&& x) noexcept;

Creates a status from a base_status and a loc.

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

Creates a status by moving from base_status and appending loc.

Status(
    Status&& base_status,
    absl::SourceLocation loc);

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());

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());

Parameters

Name

Description

x

The status to copy from.

base_status

The status to copy.

loc

The source location to append to the location chain.

code

The canonical error code for the status.

msg

The UTF‐8 error message.

Created with MrDocs