Skip to content

Commit

Permalink
[#146] Fix C++ field constructor for optional fields with simple types
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Oct 30, 2019
1 parent 8a627e8 commit 75154b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/extensions/cpp/freemarker/CompoundField.inc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ${I}if (in.readBool())
${I}{
<@compound_read_field_inner field, compoundName, indent + 1/>
${I}}
${I}

${I}return ::zserio::NullOpt;
<#else>
<@compound_read_field_inner field, compoundName, indent/>
Expand Down Expand Up @@ -547,10 +547,10 @@ ${I}<@field_member_name field/>(::std::move(other.<@field_member_name field/>))<
${I}m_objectChoice(::std::forward<ZSERIO_T>(value))
<#else>
${I}<@field_member_name field/>(<#rt>
<#if field.isSimpleType>
<@field_argument_name field/><#t>
<#else>
<#if !field.isSimpleType || field.optional??>
::std::forward<ZSERIO_T_${field.name}>(<@field_argument_name field/>)<#t>
<#else>
<@field_argument_name field/><#t>
</#if>
<#lt>)<#if hasNext>,</#if>
</#if>
Expand Down

0 comments on commit 75154b3

Please sign in to comment.