|
@@ -54,12 +54,6 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- Result(const ValueType& res, const ErrorType& error)
|
|
|
- : m_result(res)
|
|
|
- , m_error(error)
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
Result(Result&& other) = default;
|
|
|
Result(const Result& other) = default;
|
|
|
~Result() = default;
|
|
@@ -79,6 +73,16 @@ public:
|
|
|
return m_error.has_value();
|
|
|
}
|
|
|
|
|
|
+ ValueType release_value()
|
|
|
+ {
|
|
|
+ return m_result.release_value();
|
|
|
+ }
|
|
|
+
|
|
|
+ ErrorType release_error()
|
|
|
+ {
|
|
|
+ return m_error.release_value();
|
|
|
+ }
|
|
|
+
|
|
|
private:
|
|
|
Optional<ValueType> m_result;
|
|
|
Optional<ErrorType> m_error;
|
|
@@ -113,6 +117,11 @@ public:
|
|
|
return m_error.has_value();
|
|
|
}
|
|
|
|
|
|
+ void release_error()
|
|
|
+ {
|
|
|
+ return m_error.release_value();
|
|
|
+ }
|
|
|
+
|
|
|
private:
|
|
|
Optional<ErrorType> m_error;
|
|
|
};
|