30 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value>::type>
61 , m_value(std::move(value))
69 assert(this->
isOk() &&
"Acessing value of erroneous result.");
80 return std::move(m_value);
87 const V* operator -> () const noexcept {
107 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value == false>::type>
129 , m_value(std::move(value))
137 assert(this->
isOk() &&
"Acessing value of erroneous result.");
148 return std::move(m_value);
155 const V* operator -> () const noexcept {
177 typename std::remove_const<typename std::remove_reference<V>::type>::type>
180 typename std::remove_const<typename std::remove_reference<V>::type>::type>(
182 std::forward<V>(value));
V ValueType
Result value type.
Definition: ResultValue.h:114
V && takeValue() noexcept
Gets result value as rvalue.
Definition: ResultValue.h:147
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition: ResultValue.h:59
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
R EnumType
Result enumeration type.
Definition: ResultValue.h:111
R EnumType
Result enumeration type.
Definition: ResultValue.h:34
ResultValue(R result, const V &value) noexcept
Initializes result.
Definition: ResultValue.h:50
const V & getValue() const noexcept
Gets result value.
Definition: ResultValue.h:68
V m_value
Actual value.
Definition: ResultValue.h:160
V && takeValue() noexcept
Gets result value as rvalue.
Definition: ResultValue.h:79
const V & getValue() const noexcept
Gets result value.
Definition: ResultValue.h:136
ResultValue< R, typename std::remove_const< typename std::remove_reference< V >::type >::type > makeResultValue(R result, V &&value) noexcept
Addon for Result to output some value aside the result.
Definition: ResultValue.h:178
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:25
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition: ResultValue.h:127
ResultValue(R result) noexcept
Initializes result.
Definition: ResultValue.h:42
V ValueType
Result value type.
Definition: ResultValue.h:37
ResultValue(R result) noexcept
Initializes result.
Definition: ResultValue.h:119
V m_value
Actual value.
Definition: ResultValue.h:92
bool isOk() const noexcept
Checks for a success.
Definition: Result.h:63