Skip to content

Make Gaudi::Functional constructors more paranoid about # of inputs/outputs

Gerhard Raven requested to merge tweak-functional-constructors into master

Currenly, the constructors of the Gaudi::Functional baseclasses use std::array<KeyValue,N> as arguments where N is the number of inputs or outputs specified. However, this implies that one can specify a list of less than N KeyValues, as std::array will happily default-initialize any missing items. This will then result in an error in genConf, as this implies a property with a default-initialized string (i.e. an empty string) as key.

This is fixed by replacing the use std::array<KeyValue,N> with a tuple with N KeyValues, eg. for N=2 an std::tuple<KeyValue,KeyValue>.

Warning/Caveat: some (rare) user code may have hardwired the assumption of an std::array, and thus will have to be migrated. To easy this migration, the version which uses std::tuple also defines the preprocessor symbol GAUDI_FUNCTIONAL_CONSTRUCTOR_USES_TUPLE, which can be used to adapt the client code in a backwards compatible manner.

Edited by Gerhard Raven

Merge request reports

Loading