26 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value>::type>
57 , m_value(std::move(value))
65 assert(this->
isOk() &&
"Acessing value of erroneous result.");
76 return std::move(m_value);
83 const V* operator -> () const noexcept {
103 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value == false>::type>
125 , m_value(std::move(value))
133 assert(this->
isOk() &&
"Acessing value of erroneous result.");
144 return std::move(m_value);
151 const V* operator -> () const noexcept {
173 typename std::remove_const<typename std::remove_reference<V>::type>::type>
176 typename std::remove_const<typename std::remove_reference<V>::type>::type>(
178 std::forward<V>(value));
V ValueType
Result value type.
Definition: ResultValue.h:110
V && takeValue() noexcept
Gets result value as rvalue.
Definition: ResultValue.h:143
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition: ResultValue.h:55
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
R EnumType
Result enumeration type.
Definition: ResultValue.h:107
R EnumType
Result enumeration type.
Definition: ResultValue.h:30
ResultValue(R result, const V &value) noexcept
Initializes result.
Definition: ResultValue.h:46
const V & getValue() const noexcept
Gets result value.
Definition: ResultValue.h:64
V m_value
Actual value.
Definition: ResultValue.h:156
V && takeValue() noexcept
Gets result value as rvalue.
Definition: ResultValue.h:75
const V & getValue() const noexcept
Gets result value.
Definition: ResultValue.h:132
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:174
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:21
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition: ResultValue.h:123
ResultValue(R result) noexcept
Initializes result.
Definition: ResultValue.h:38
V ValueType
Result value type.
Definition: ResultValue.h:33
ResultValue(R result) noexcept
Initializes result.
Definition: ResultValue.h:115
V m_value
Actual value.
Definition: ResultValue.h:88
bool isOk() const noexcept
Checks for a success.
Definition: Result.h:63