Returns true if the Result is equal to another Result
Class Result<OkType, ErrType>
#include <Result.hpp>
Examples0
Public static methods0
Public member functions50
geode::Result&operator=(geode::Result&&other)
template<class OkType2,class ErrType2>booloperator==()const
other
template<class OkType2>booloperator==()const
Returns true if the Result is equal to an Ok value
other
template<class ErrType2>booloperator==()const
Returns true if the Result is equal to an Err value
other
template<class OkType2,class ErrType2>booloperator!=()const
Returns true if the Result is not equal to another Result
other
template<class OkType2>booloperator!=()const
Returns true if the Result is not equal to an Ok value
other
template<class ErrType2>booloperator!=()const
Returns true if the Result is not equal to an Err value
other
autooperator*()
Unwraps the Ok value from the Result
ℹ Same behavior as Result::unwrap()
autooperator*()
Unwraps the Ok value from the Result
ℹ Same behavior as Result::unwrap()
autooperator*()const
Unwraps the Ok value from the Result
ℹ Same behavior as Result::unwrap()
boolisOkAnd(std::invocable<OkType> auto&&predicate)
boolisOkAnd(std::invocable<OkType> auto&&predicate)const
boolisErrAnd(std::invocable<ErrType> auto&&predicate)
boolisErrAnd(std::invocable<ErrType> auto&&predicate)const
std::optional<OkType>ok()
Returns an std::optional containing the Ok value
std::optional<OkType>ok()const
Returns an std::optional containing the Ok value
std::optional<ErrType>err()
Returns an std::optional containing the Err value
std::optional<ErrType>err()const
Returns an std::optional containing the Err value
template<class Operation>geode::Result<std::invoke_result_t<Operation,OkType>,ErrType>map(Operation&&operation)
Maps the Ok value to a new Ok value using an operation
operation
template<class Operation>geode::Result<std::invoke_result_t<Operation,OkType>,ErrType>map(Operation&&operation)const
Maps the Ok value to a new Ok value using an operation
operation
template<class Operation>geode::Result<std::invoke_result_t<Operation>,ErrType>map(Operation&&operation)
Maps the Ok value to a new Ok value using an operation
operation
template<class Operation>geode::Result<std::invoke_result_t<Operation>,ErrType>map(Operation&&operation)const
Maps the Ok value to a new Ok value using an operation
operation
template<class OkType2,class Operation>OkType2mapOr(OkType2&&defaultValue,Operation&&operation)
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class OkType2,class Operation>OkType2mapOr(OkType2&&defaultValue,Operation&&operation)const
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class OkType2,class Operation>OkType2mapOr(OkType2&&defaultValue,Operation&&operation)
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class DefaultValue,class Operation>std::invoke_result_t<Operation,OkType>mapOrElse(DefaultValue&&defaultValue,Operation&&operation)
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class DefaultValue,class Operation>std::invoke_result_t<Operation,OkType>mapOrElse(DefaultValue&&defaultValue,Operation&&operation)const
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class DefaultValue,class Operation>std::invoke_result_t<Operation>mapOrElse(DefaultValue&&defaultValue,Operation&&operation)
Maps the Ok value to a new value using an operation
defaultValue
operation
template<class Operation>geode::Result<OkType,std::invoke_result_t<Operation,ErrType>>mapErr(Operation&&operation)
Maps the Err value to a new Err value using an operation
operation
template<class Operation>geode::Result<OkType,std::invoke_result_t<Operation,ErrType>>mapErr(Operation&&operation)const
Maps the Err value to a new Err value using an operation
operation
template<class Operation>geode::Result<OkType,std::invoke_result_t<Operation>>mapErr(Operation&&operation)
Maps the Err value to a new Err value using an operation
operation
template<class Operation>geode::Result<OkType,std::invoke_result_t<Operation>>mapErr(Operation&&operation)const
Maps the Err value to a new Err value using an operation
operation
template<class Fn>geode::Result<OkType,ErrType>&inspect(Fn&&operation)
Inspects the Ok value with an operation
operation
template<class Fn>geode::Result<OkType,ErrType>&inspectErr(Fn&&operation)
Inspects the Err value with an operation
operation
template<class OkType2>geode::Result<OkType2,ErrType>and_()
Returns the other Result if this Result is Ok, otherwise returns this Result
other
template<class OkType2>geode::Result<OkType2,ErrType>and_()const
Returns the other Result if this Result is Ok, otherwise returns this Result
other
template<class Operation>std::invoke_result_t<Operation,OkType>andThen(Operation&&operation)
Returns the result of an operation if this Result is Ok, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation,OkType>andThen(Operation&&operation)const
Returns the result of an operation if this Result is Ok, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation>andThen(Operation&&operation)
Returns the result of an operation if this Result is Ok, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation>andThen(Operation&&operation)const
Returns the result of an operation if this Result is Ok, otherwise returns this Result
operation
template<class ErrType2>geode::Result<OkType,ErrType2>or_()
Returns the other Result if this Result is Err, otherwise returns this Result
other
template<class ErrType2>geode::Result<OkType,ErrType2>or_()const
Returns the other Result if this Result is Err, otherwise returns this Result
other
template<class Operation>std::invoke_result_t<Operation,ErrType>orElse(Operation&&operation)
Returns the result of an operation if this Result is Err, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation,ErrType>orElse(Operation&&operation)const
Returns the result of an operation if this Result is Err, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation>orElse(Operation&&operation)
Returns the result of an operation if this Result is Err, otherwise returns this Result
operation
template<class Operation>std::invoke_result_t<Operation>orElse(Operation&&operation)const
Returns the result of an operation if this Result is Err, otherwise returns this Result
operation
std::optional<geode::Result<geode::impl::OptionalType<OkType>,ErrType>>transpose()
Transposes the Result from Result<std::optional Transposes the Result from Result<std::optional Flattens the Result from Result<Result<OkType, ErrType>, ErrType> to Result<OkType, ErrType> Flattens the Result from Result<Result<OkType, ErrType>, ErrType> to Result<OkType, ErrType>std::optional<geode::Result<geode::impl::OptionalType<OkType>,ErrType>>transpose()const
geode::Result<geode::impl::ResultOkType<OkType>,ErrType>flatten()
geode::Result<geode::impl::ResultOkType<OkType>,ErrType>flatten()const
Fields0
Protected member functions0
Protected fields0