Reviewers: Sven Panne,

Message:
As discussed, moving Maybe template into public header. Let me know if you want
it moved elsewhere in this header or want a more detailed comment.

Description:
Move Maybe template into v8.h so it can be used by SetResourceConstraints

BUG=

Please review this at https://codereview.chromium.org/23767009/

SVN Base: https://v8.googlecode.com/svn/trunk

Affected files (+15, -12 lines):
  M include/v8.h
  M src/globals.h


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 ---


Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index d0a57a4039f4d59ff0194f0cb4c537b635e7a9db..992f3a866f29d515927e8a3c80dc3cd64427b010 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -393,18 +393,6 @@ enum LanguageMode {
 };


-// A simple Maybe type, that can be passed by 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;
-};
-
-
 // The Strict Mode (ECMA-262 5th edition, 4.2.2).
 //
 // This flag is used in the backend to represent the language mode. So far


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to