absl::StatusOr::StatusOr

Constructors

Synopses

Declared in <absl/status/statusor.h>

Constructs a new StatusOr with an unknown status.

explicit
StatusOr();
» more...

Copy constructor.

StatusOr(StatusOr const& other) = default;
» more...

Constructs a StatusOr<T> from an absl::StatusOr<U>.

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                false, T, U, false, const U&>::value
StatusOr(StatusOr<U> const& other);
» more...

Converting constructor from a StatusOr<U> (lifetime-bound overload).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                false, T, U, true, const U&>::value
StatusOr(StatusOr<U> const& other);
» more...

Converting constructor from a StatusOr<U> (explicit overload).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                true, T, U, false, const U&>::value
explicit
StatusOr(StatusOr<U> const& other);
» more...

Converting constructor from a StatusOr<U> (explicit, lifetime-bound).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                true, T, U, true, const U&>::value
explicit
StatusOr(StatusOr<U> const& other);
» more...

Move constructor.

StatusOr(StatusOr&& other) = default;
» more...

Converting move constructor from a StatusOr<U>.

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                false, T, U, false, U&&>::value
StatusOr(StatusOr<U>&& other);
» more...

Converting move constructor from a StatusOr<U> (lifetime-bound overload).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                false, T, U, true, U&&>::value
StatusOr(StatusOr<U>&& other);
» more...

Converting move constructor from a StatusOr<U> (explicit overload).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                true, T, U, false, U&&>::value
explicit
StatusOr(StatusOr<U>&& other);
» more...

Converting move constructor from a StatusOr<U> (explicit, lifetime-bound).

template<typename U>
requires internal_statusor::IsConstructionFromStatusOrValid<
                                true, T, U, true, U&&>::value
explicit
StatusOr(StatusOr<U>&& other);
» more...

Constructs the inner value T by direct-initialization from u.

template<typename U = T>
requires internal_statusor::IsConstructionValid<
                                 false, T, U, false>::value
StatusOr(U&& u);
» more...

Direct-initializes the held value from u (lifetime-bound overload).

template<typename U = T>
requires internal_statusor::IsConstructionValid<
                                 false, T, U, true>::value
StatusOr(U&& u);
» more...

Direct-initializes the held value from u (explicit overload).

template<typename U = T>
requires internal_statusor::IsConstructionValid<
                                 true, T, U, false>::value
explicit
StatusOr(U&& u);
» more...

Direct-initializes the held value from u (explicit, lifetime-bound).

template<typename U = T>
requires internal_statusor::IsConstructionValid<true, T, U, true>::value
explicit
StatusOr(U&& u);
» more...

Constructs a new StatusOr<T> from a value convertible to Status.

template<typename U = absl::Status>
requires internal_statusor::IsConstructionFromStatusValid<
                                 false, T, U>::value
StatusOr(U&& v);
» more...

Constructs a new StatusOr<T> from a value convertible to Status (explicit overload).

template<typename U = absl::Status>
requires internal_statusor::IsConstructionFromStatusValid<
                                  true, T, U>::value
explicit
StatusOr(U&& v);
» more...

Constructs the inner value T in-place from the given arguments.

template<typename... Args>
explicit
StatusOr(
    std::in_place_t tag,
    Args&&... args);
» more...

Constructs the inner value T in-place from an initializer list and args.

template<
    typename U,
    typename... Args>
explicit
StatusOr(
    std::in_place_t tag,
    std::initializer_list<U> ilist,
    Args&&... args);
» more...

Parameters

NameDescription
otherThe source object.
uThe value used to direct-initialize the held object.
vThe status (or value convertible to a status) to store.
argsThe arguments forwarded to the T constructor.
tagA tag that selects this overload.
ilistThe initializer list forwarded to the T constructor.