absl::StatusOr::emplace

Reconstructs the held value in-place from the given arguments.

Synopsis

Declared in <absl/status/statusor.h>

template<typename... Args>
T&
emplace(Args&&... args);

Description

Reconstructs the inner value T in-place using the provided args, using the T(args...) constructor. Returns reference to the reconstructed T.

Return Value

A reference to the reconstructed value.

Parameters

NameDescription
argsThe arguments forwarded to the T constructor.