17#ifndef OBOE_RESULT_WITH_VALUE_H
18#define OBOE_RESULT_WITH_VALUE_H
20#include "oboe/Definitions.h"
66 , mError(oboe::Result::OK) {}
88 explicit operator bool()
const {
return mError == oboe::Result::OK; }
100 bool operator !()
const {
return mError != oboe::Result::OK; }
110 operator Result()
const {
124 static_assert(std::is_arithmetic<T>::value,
125 "createBasedOnSign can only be called for numeric types (int or float)");
136 const oboe::Result mError;
143std::ostream& operator<<(std::ostream &strm,
const ResultWithValue<T> &result) {
145 strm << convertToText(result.error());
147 strm << result.value();
Definition ResultWithValue.h:47
bool operator!() const
Definition ResultWithValue.h:100
T value() const
Definition ResultWithValue.h:81
ResultWithValue(T value)
Definition ResultWithValue.h:64
static ResultWithValue< T > createBasedOnSign(T numericResult)
Definition ResultWithValue.h:121
ResultWithValue(oboe::Result error)
Definition ResultWithValue.h:55
oboe::Result error() const
Definition ResultWithValue.h:73