From 41df6d94b734a98f77b27794b9289be2391bc29b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sat, 1 Dec 2018 21:09:48 -0800 Subject: [PATCH] Allow Result to be constructed with an l-value This fixes compile errors on old C++ compilers --- src/compiler/util/result.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/util/result.h b/src/compiler/util/result.h index 8e444dc7..448ad1af 100644 --- a/src/compiler/util/result.h +++ b/src/compiler/util/result.h @@ -12,7 +12,8 @@ struct Result { std::string error; inline Result() : error("Empty") {} - inline Result(Value &&v) : value(v) {} + inline Result(const Value &v) : value(v) {} + inline Result(Value &&v) : value(std::move(v)) {} inline Result(const std::string &message) : error(message) {} inline Result(const char *message) : error(message) {} inline bool ok() const { return error.empty(); }