Skip to content

EventContext: make constructor explicit

Frank Winklmeier requested to merge fwinkl/Gaudi:explicit_ctx into master

We do not want to implicitly convert an integer to an EventContext as this would almost certainly result in an invalid event context.

We just had a case in ATLAS where something like the following code compiled fine and only at runtime we got an invalid EventContext error:

void foo(const EventContext& ctx);

int context; // variable incidentally named context that has nothing to do with an `EventContext`

Thanks to @bstanisl for pointing this out. cc @smh

Merge request reports