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 a26601e72ff92f63404e38c43018402c9d015e15..feb861569fd766f5394c25764de2bb85d1253162 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 |
@@ -1,12 +1,11 @@ |
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 New( |
{%- for field in struct.fields %} |
- rv->{{field.name}} = mojo::Clone({{field.name}}); |
+ mojo::Clone({{field.name}}) |
+{%- if not loop.last -%},{%- endif %} |
{%- endfor %} |
- return rv; |
+ ); |
} |
template <typename T, |