MCRO
C++23 utilities for Unreal Engine.
|
#include <Error.h>
Public Types | |
using | ValueType = T |
Public Member Functions | |
template<typename = T> requires (!CDefaultInitializable<T>) | |
TMaybe () | |
template<CDefaultInitializable = T> | |
TMaybe () | |
template<CConvertibleToDecayed< T > From, CCopyConstructible = T> | |
TMaybe (From const &value) | |
template<CConvertibleToDecayed< T > From, CMoveConstructible = T> | |
TMaybe (From &&value) | |
template<CConvertibleToDecayed< T > From, CCopyConstructible = T> | |
TMaybe (TMaybe< From > const &other) | |
template<CConvertibleToDecayed< T > From, CMoveConstructible = T> | |
TMaybe (TMaybe< From > &&other) | |
template<CError ErrorType> | |
TMaybe (TSharedRef< ErrorType > const &error) | |
bool | HasValue () const |
bool | HasError () const |
auto | TryGetValue () -> TOptional< T > & |
auto | TryGetValue () const -> TOptional< T > const & |
auto | GetValue () -> T & |
auto | GetValue () const -> T const & |
auto | GetError () const -> IErrorPtr |
operator bool () const | |
operator TValueOrError< T, IErrorPtr > () const | |
A TValueOrError alternative for IError which allows implicit conversion from values and errors (no need for MakeError
or MakeValue
) and is boolean testable. It also doesn't have ambiguous state such as TValueOrError has, so a TMaybe will always have either an error or a value, it will never have neither of them or both of them.
using Mcro::Error::TMaybe< T >::ValueType = T |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |