3#include <fsdk/Types/Result.h>
20 template <
typename R,
typename V,
class Enable =
void>
23 template <
typename R,
typename V>
24 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value>::type> :
Result<R> {
54 , m_value(std::move(value)) {
62 assert(this->
isOk() &&
"Acessing value of erroneous result.");
73 return std::move(m_value);
97 template <
typename R,
typename V>
98 struct ResultValue<R, V, typename std::enable_if<std::is_copy_constructible<V>::value == false>::type> :
120 , m_value(std::move(value)) {
128 assert(this->
isOk() &&
"Acessing value of erroneous result.");
139 return std::move(m_value);
164 template <
typename R,
typename V>
169 std::forward<V>(value));
SDK namespace.
Definition IAGSEstimator.h:8
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:166
A structure that encapsulates an action result enumeration.
Definition Result.h:27
bool isOk() const noexcept
Definition Result.h:62
R EnumType
Result enumeration type.
Definition ResultValue.h:26
const V & getValue() const noexcept
Gets result value.
Definition ResultValue.h:61
ResultValue(R result, const V &value) noexcept
Initializes result.
Definition ResultValue.h:43
V && takeValue() noexcept
Gets result value as rvalue.
Definition ResultValue.h:72
const V * operator->() const noexcept
Gets result value.
Definition ResultValue.h:80
ResultValue(R result) noexcept
Initializes result.
Definition ResultValue.h:34
V ValueType
Result value type.
Definition ResultValue.h:29
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition ResultValue.h:52
V m_value
Actual value.
Definition ResultValue.h:85
ResultValue(R result, V &&value) noexcept
Initializes result.
Definition ResultValue.h:118
const V * operator->() const noexcept
Gets result value.
Definition ResultValue.h:146
ResultValue(R result) noexcept
Initializes result.
Definition ResultValue.h:109
R EnumType
Result enumeration type.
Definition ResultValue.h:101
V m_value
Actual value.
Definition ResultValue.h:151
const V & getValue() const noexcept
Gets result value.
Definition ResultValue.h:127
V && takeValue() noexcept
Gets result value as rvalue.
Definition ResultValue.h:138
V ValueType
Result value type.
Definition ResultValue.h:104
Addon for Result to output some value aside the result. Specialization for copiable types.
Definition ResultValue.h:21