Constructors

Synopses

Declared in <absl/status/statusor.h>

Constructs a new StatusOr with an unknown status.

explicit
StatusOr();

Copy constructor.

StatusOr(StatusOr const& other) = default;

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);

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);

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);

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);

Move constructor.

StatusOr(StatusOr&& other) = default;

Converting move constructor from a StatusOr<U>.

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

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);

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);

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);

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);

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);

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);

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);

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);

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);

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

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

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);

Parameters

Name

Description

other

The source object.

u

The value used to direct‐initialize the held object.

v

The status (or value convertible to a status) to store.

args

The arguments forwarded to the T constructor.

tag

A tag that selects this overload.

ilist

The initializer list forwarded to the T constructor.

Created with MrDocs