absl::StatusOr::emplace

emplace overloads

Synopses

Declared in <absl/status/statusor.h>

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

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

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

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);
» more...

Return Value

A reference to the reconstructed value.

Parameters

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