absl::StatusOr::emplace

Reconstructs the held value in-place from an initializer list and args.

Synopsis

Declared in <absl/status/statusor.h>

template<
    typename U,
    typename... Args>
requires std::is_constructible_v<
                                 T, std::initializer_list<U>&, Args&&...>
T&
emplace(
    std::initializer_list<U> ilist,
    Args&&... args);

Return Value

A reference to the reconstructed value.

Parameters

NameDescription
ilistThe initializer list forwarded to the T constructor.
argsThe additional arguments forwarded to the T constructor.