chromium/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl

template <typename StructPtrType>
{{struct.name}}Ptr {{struct.name}}::Clone() const {
  return New(
{%- for field in struct.fields %}
      mojo::Clone({{field.name}})
{%-   if not loop.last -%},{%- endif %}
{%- endfor %}
  );
}

template <typename T, {{struct.name}}::EnableIfSame<T>*>
bool {{struct.name}}::Equals(const T& other_struct) const {
{%- for field in struct.fields %}
  if (!mojo::Equals(this->{{field.name}}, other_struct.{{field.name}}))
    return false;
{%- endfor %}
  return true;
}

template <typename T, {{struct.name}}::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
{%- for field in struct.fields %}
  if (lhs.{{field.name}} < rhs.{{field.name}})
    return true;
  if (rhs.{{field.name}} < lhs.{{field.name}})
    return false;
{%- endfor %}
  return false;
}