Skip to content

GMR-196: Default initialise the key value in KeyedObject.

Charles Leggett requested to merge leggett/AtlasGaudi:dev/GMR-196 into atlas/v27r2

apply Gaudi Merge Request 196: gaudi/Gaudi!196 (merged)

Default initialise the key value in KeyedObject.

Currently the value of the key in KeyedObject is uninitialised in the default constructor. This means the value of the key is undefined until it is explicitly set, when the object is saved to a container. This can cause annoyances, for instance when I was recently investigating differences between different builds (opt versus debug) in the LHCb software stack. In this scenario I was using some standard debug printout in various algorithms, that often print data objects, including their keys, before they are saved to containers. Differences in the default key value was causing annoying 'white-noise' in the diffs I was then comparing.

The previous comment suggests this was intentional, but I do not really see the need for this. The proposed patch here adds a default initialiser ({}) and in my tests with the LHCb software stack removed the deferences I was seeing between builds.

Merge request reports

Loading