18 template<
typename ResultType >
30 , Value( ResultType() )
37 , Value( ResultType() )
42 : ErrorString( std::move( error ) )
44 , Value( ResultType() )
49 : Value( std::move( result ) )
54 : ErrorString( other.ErrorString )
55 , IsValid( other.IsValid )
56 , Value( other.Value )
60 : ErrorString( std::move( other.ErrorString ) )
61 , IsValid( other.IsValid )
62 , Value( std::move( other.Value ) )
74 Value = std::move( other.Value );
75 IsValid = other.IsValid;
76 ErrorString = std::move( other.ErrorString );
87 #define ReturnIfInvalid( nullable ) if( !nullable.IsValid ) return std::move( nullable.ErrorString );
void operator=(Nullable< ResultType > &&other)
Definition: Nullable.h:72
std::string ErrorString
Definition: Nullable.h:23
Nullable(Nullable< ResultType > &&other)
Definition: Nullable.h:59
Nullable(std::string &&error)
Creates invalid object and sets error string. Value fieled is default contructed. ...
Definition: Nullable.h:41
bool IsValid
Definition: Nullable.h:22
Returns value or error.
Definition: Nullable.h:19
bool operator!()
Definition: Nullable.h:80
Nullable(const Nullable< ResultType > &other)
Definition: Nullable.h:53
NullableInit
Definition: Nullable.h:11
ResultType Value
Definition: Nullable.h:21
Nullable(NullableInit)
Creates valid object. Value fieled is default contructed.
Definition: Nullable.h:35
Nullable()
Creates invalid object. Value fieled is default contructed.
Definition: Nullable.h:28
Nullable(ResultType &&result)
Creates valid object.
Definition: Nullable.h:48
void operator=(const Nullable< ResultType > &other)
Definition: Nullable.h:65