Skip to content

Commit

Permalink
Fix constant definition - add cast for simple types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Dec 2, 2024
1 parent dd3f45e commit 32d6a7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/extensions/cpp/freemarker/Constant.h.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<#if withCodeComments && docComments??>
<@doc_comments docComments/>
</#if>
constexpr ${typeInfo.typeFullName} ${name} = ${value};
constexpr ${typeInfo.typeFullName} ${name} = <#if typeInfo.isSimple>static_cast<${typeInfo.typeFullName}>(</#if><#rt>
<#lt>${value}<#if typeInfo.isSimple>)</#if>;
<@namespace_end package.path/>

<@include_guard_end package.path, name/>

0 comments on commit 32d6a7c

Please sign in to comment.