A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/aeron-io/simple-binary-encoding/issues/591 below:

Constant field getter static constexpr cpp · Issue #591 · aeron-io/simple-binary-encoding · GitHub

Using SBE Tool v1.7.9:

Because the field is not constexpr we cannot use this methods in template metaprogramming, and instead we have created python scripts to post process and fix the generated code

Given the following schema: (escaped < below)
<types>
<enum name="EnumSBESample" encodingType="uint8" semanticType="EnumSBESample">
<validValue name="a">0</validValue>
<validValue name="b">1</validValue>
</enum>
</types>

<sbe:message name="MsgSBESample" id="1023" semanticType="MsgSBESample">
<field name="fieldConstant" id="1" type="EnumSBESample" presence="constant" semanticType="EnumSBESample" valueRef="EnumSBESample.a" />
</sbe:message>

Consider generating
static SBE_CONSTEXPR EnumSBESample::Value fieldConstant() SBE_NOEXCEPT

{ return EnumSBESample::Value::a; }

Instead of
EnumSBESample::Value fieldConstant() const SBE_NOEXCEPT

{ return EnumSBESample::Value::a; }


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4