Implicitly cast result value to OK result with given value.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-12-11 16:25:18 +01:00
parent 6f932f375f
commit e3853bf290
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,10 @@ namespace ArbUt {
/// @return The result class
inline static const Result& Error(const std::string& message) { return Result(message); }
/// @brief Implicitly return a success result with a value.
/// @param value The value to return.
inline Result(const T& value) : Result(ResultStatus::Ok, value) {}
/// @brief Returns whether or not the function succeeded,
/// @return Whether or not the function succeeded.
[[nodiscard]] inline ResultStatus GetStatus() const noexcept { return _resultStatus; }