Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index ba4d19b01d45bba7981f4849eafcd81acc49ad37..73bf3281a38a1040bbdcb791895eb378b11d6820 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -877,6 +877,21 @@ class V8_EXPORT HandleScope { |
}; |
+/** |
+ * A simple Maybe type, representing an object which may or may not have a |
+ * value. |
+ */ |
+template<class T> |
+struct Maybe { |
+ Maybe() : has_value(false) {} |
+ explicit Maybe(T t) : has_value(true), value(t) {} |
+ Maybe(bool has, T t) : has_value(has), value(t) {} |
+ |
+ bool has_value; |
+ T value; |
+}; |
+ |
+ |
// --- Special objects --- |