|
template<typename = T>
requires (!CDefaultInitializable<T>) |
| | TMaybe () |
| | Default initializing a TMaybe while its value is not default initializable, initializes the resulting TMaybe to an erroneous state.
|
| |
| template<CDefaultInitializable = T> |
| | TMaybe () |
| | If T is default initializable then the default state of TMaybe will be the default value of T, and not an error.
|
| |
| template<CConvertibleToDecayed< T > From, CCopyConstructible = T> |
| | TMaybe (From const &value) |
| | Enable copy constructor for T only when T is copy constructable.
|
| |
| template<CConvertibleToDecayed< T > From, CMoveConstructible = T> |
| | TMaybe (From &&value) |
| | Enable move constructor for T only when T is move constructable.
|
| |
| template<CConvertibleToDecayed< T > From, CCopyConstructible = T> |
| | TMaybe (TMaybe< From > const &other) |
| | Enable copy constructor for TMaybe only when T is copy constructable.
|
| |
| template<CConvertibleToDecayed< T > From, CMoveConstructible = T> |
| | TMaybe (TMaybe< From > &&other) |
| | Enable move constructor for TMaybe only when T is move constructable.
|
| |
| template<CError ErrorType> |
| | TMaybe (TSharedRef< ErrorType > const &error) |
| | Set this TMaybe to an erroneous state.
|
| |
| bool | HasValue () const |
| |
| bool | HasError () const |
| |
| auto | TryGetValue () -> TOptional< T > & |
| |
| auto | TryGetValue () const -> TOptional< T > const & |
| |
| auto | GetValue () -> T & |
| |
| auto | GetValue () const -> T const & |
| |
| T && | StealValue () && |
| |
| auto | GetError () const -> IErrorPtr |
| |
| auto | GetErrorRef () const -> IErrorRef |
| |
| | operator bool () const |
| |
| template<typename Self , CFunctionCompatible_ArgumentsDecay< void(IErrorRef)> Function> |
| Self && | ModifyError (this Self &&self, Function &&mod) |
| | Modify a potential error stored in this monad.
|
| |
| | operator TValueOrError< T, IErrorPtr > () const |
| |
template<CNonVoid T>
struct Mcro::Error::TMaybe< T >
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.
Definition at line 589 of file Error.h.