BxCppDev / Bayeux

Core Persistency, Geometry and Data Processing C++ Library for Particle and Nuclear Physics Experiments
GNU General Public License v3.0
4 stars 9 forks source link

Variant missing support for a @variant_else/default directive #19

Closed fmauger closed 6 years ago

fmauger commented 6 years ago

Investigate if such construction would make sense:

Example:

[name="foo" type="bar"]

#@variant_only "@cfg:duck/if_donald|true"
color: string = "white"

#@variant_only "@cfg:duck/if_daffy|false"
color: string = "black"

#@variant_default  # NEW DIRECTIVE CANDIDATE
color: string =  "blue"

Remark: The following construct is probably a valuable solution:

[name="foo" type="bar"]
#@variant_section   "@cfg:duck/if_donald|true"
color: string = "white"

[name="foo" type="bar"]
#@variant_section   "@cfg:duck/if_daffy|false"
color: string = "white"
fmauger commented 6 years ago

We don't change/add anything for now to keep the variant conditional preprocessor system as simple as possible.