checked cpp: add isl::boolean::release
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Wed, 19 Jul 2017 13:45:46 +0000 (19 15:45 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 8 Sep 2018 08:49:53 +0000 (8 10:49 +0200)
This allows the isl_bool value to be extracted from an isl::boolean,
which is needed to convert an isl::bool callback return value
to an isl_bool in the next commit.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
cpp/cpp-checked.h.pre

index ad37862..a98faa2 100644 (file)
@@ -39,6 +39,13 @@ public:
   /* implicit */ boolean(bool val)
       : val(val ? isl_bool_true : isl_bool_false) {}
 
+  isl_bool release() {
+    auto tmp = val;
+    val = isl_bool_error;
+    checked = true;
+    return tmp;
+  }
+
   bool is_error() const { checked = true; return val == isl_bool_error; }
   bool is_false() const { checked = true; return val == isl_bool_false; }
   bool is_true() const { checked = true; return val == isl_bool_true; }