Index: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl |
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl |
index f4aa314fae9e1987503f7f92388102120e797809..ca1a612c1e8bee2a7e4a35d7481b5aeaa4d73cd4 100644 |
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl |
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl |
@@ -2,11 +2,12 @@ template <typename StructPtrType> |
{{struct.name}}Ptr {{struct.name}}::Clone() const { |
// Use StructPtrType to prevent the compiler from trying to compile this |
// without being asked. |
- StructPtrType rv(New()); |
+ return StructPtrType::Struct::New( |
yzshen1
2017/02/14 17:21:53
This could be
"return New("
Right?
Sam McNally
2017/02/15 06:35:49
Done.
|
{%- for field in struct.fields %} |
- rv->{{field.name}} = mojo::internal::Clone({{field.name}}); |
+ mojo::internal::Clone({{field.name}}) |
+{%- if not loop.last -%},{%- endif %} |
{%- endfor %} |
- return rv; |
+ ); |
} |
template <typename T, |