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

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

Issue 884043003: Cpp bindings: add typedef for callbacks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: use using instead of typedef in cpp templates Created 5 years, 11 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/module.h.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
index 3da6c324bdff6706558257caa6aad4eb213efc5c..25449b7ca959bf481262ee2cb8024faca338ae0b 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -40,16 +40,16 @@ extern const {{constant.kind|cpp_pod_type}} {{constant.name}};
{#--- Interface Forward Declarations -#}
{% for interface in interfaces %}
class {{interface.name}};
-typedef mojo::InterfacePtr<{{interface.name}}> {{interface.name}}Ptr;
+using {{interface.name}}Ptr = mojo::InterfacePtr<{{interface.name}}>;
{% endfor %}
{#--- Struct Forward Declarations -#}
{% for struct in structs %}
class {{struct.name}};
{% if struct|should_inline %}
-typedef mojo::InlinedStructPtr<{{struct.name}}> {{struct.name}}Ptr;
+using {{struct.name}}Ptr = mojo::InlinedStructPtr<{{struct.name}}>;
{% else %}
-typedef mojo::StructPtr<{{struct.name}}> {{struct.name}}Ptr;
+using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
{% endif %}
{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698