Allow Result to be constructed with an l-value

This fixes compile errors on old C++ compilers
This commit is contained in:
Max Brunsfeld 2018-12-01 21:09:48 -08:00
parent 6d97cbd2b6
commit 41df6d94b7

View file

@ -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(); }