From 1853e964e96c41e762ca0ab97259ee4e79d86ec7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 3 Nov 2014 13:35:54 -0800 Subject: Use the new ASTs --- src/compat/result.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/compat') diff --git a/src/compat/result.hpp b/src/compat/result.hpp index f03c026..6adc552 100644 --- a/src/compat/result.hpp +++ b/src/compat/result.hpp @@ -66,7 +66,23 @@ namespace tmwa { return Result(magic_flag, message); } + template + operator Option>() + { + return Some(Result(magic_flag, message)); + } }; + + template + bool operator == (const Result& l, const Result& r) + { + return l.get_success() == r.get_success() && l.get_failure() == r.get_failure(); + } + template + bool operator != (const Result& l, const Result& r) + { + return !(l == r); + } } // namespace result using result::Result; using result::Ok; -- cgit v1.2.3-60-g2f50