absl::Status::Status

Same as above but for rvalue string.

Synopsis

Declared in <absl/status/status.h>

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

Description

Note: using a template to disambiguate the case of matching string_view and string&& (e.g. char*) as a template lowers the priority of the overload.

Parameters

NameDescription
codeThe canonical error code for the status.
msgThe UTF-8 error message.
locThe source location of the callsite.