HepMC3 migration: Use auto more often when it is apropriate in the current codes
In this MR the usage of auto
is expanded.
Most cases are related to expressions like
auto vert=particle->end_vertex();
if (vert) {
...
}
For these cases:
-
The type of the variable is clear for humans, so the readability does not suffer. It is
HepMC::GenVertex*
for HepMC orHepMC3::GenVertexPtr
HepMC3. Modulo specifier. -
The compiler will take care of the correct specifier and avoid casts.
-
The code reads the same for HepMC and HepMC3.
In addition to the auto
, the HepMC::FourVector
is used explicitly.
Andrii
Edited by Andrii Verbytskyi