diff --git a/src/Result.hpp b/src/Result.hpp index bfef008..ad3bc5c 100644 --- a/src/Result.hpp +++ b/src/Result.hpp @@ -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; }