absl::StatusBuilder::AttachPayload

Attaches a MessageSet extension payload to the result status.

Synopsis

Declared in <absl/status/status_builder.h>

template<
    typename MessageSetExtension,
    typename ExtensionIdentifier>
[[nodiscard]]
decltype(std::move(AttachPayload(obj, id)))
AttachPayload(
    MessageSetExtension const& obj,
    ExtensionIdentifier const& id) &&;

Description

As above, but &&-qualified. Uses decltype() to propagate template constraints (SFINAE).

Return Value

*this to allow method chaining.

NOTE

The return value should not be discarded.

Parameters

NameDescription
objThe extension message to attach.
idThe extension identifier for obj.