Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1334)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
index 36856e8f601e8bb50b3b52d7aff2169aabb64ecc..0a446a7cb9abb307e62c14e6e4139a38c0bff2d0 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
@@ -75,3 +75,9 @@ inline bool IsKnownEnumValue({{enum|get_name_for_kind}} value) {
static_cast<int32_t>(value));
}
{%- endmacro %}
+
+{%- macro enum_hash(enum) %}
+template <>
+struct hash<{{enum|get_qualified_name_for_kind}}>
+ : public mojo::internal::EnumHashImpl<{{enum|get_qualified_name_for_kind}}> {};
+{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698