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

{%- for field in union.fields %}
{%-   set kind = field.kind %}
{%-   set name = field.name %}

{%-   if kind|is_object_kind %}
inline void {{union.name}}DataView::Get{{name|under_to_camel}}DataView(
    {{kind|cpp_data_view_type}}* output) const {
  CHECK(is_{{name}}());
  *output = {{kind|cpp_data_view_type}}(data_->data.f_{{name}}.Get(), message_);
}
{%-   endif %}
{%- endfor %}