5#ifndef FLUTTER_FML_STATUS_OR_H_
6#define FLUTTER_FML_STATUS_OR_H_
10#include "flutter/fml/logging.h"
11#include "flutter/fml/status.h"
63 value_ = std::move(
value);
69 value_ = std::nullopt;
75 bool ok()
const {
return status_.
ok(); }
78 if (value_.has_value()) {
80 return value_.value();
82 FML_LOG(
FATAL) <<
"StatusOr::value() called on error Status";
87 if (value_.has_value()) {
89 return value_.value();
91 FML_LOG(
FATAL) <<
"StatusOr::value() called on error Status";
97 std::optional<T> value_;
const Status & status() const
StatusOr(StatusOr &&)=default
StatusOr & operator=(const T &&value)
StatusOr & operator=(const StatusOr &)=default
StatusOr(const StatusOr &)=default
StatusOr & operator=(const T &value)
StatusOr(const Status &status)
StatusOr & operator=(StatusOr &&)=default
StatusOr & operator=(const Status &value)
#define FML_LOG(severity)
#define FML_CHECK(condition)
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)