From 45fe8f0dd34b59406fafa3ce11986e216b91ae9d Mon Sep 17 00:00:00 2001 From: Alex Pearce <alex@alexpearce.me> Date: Fri, 30 Jul 2021 17:12:20 +0200 Subject: [PATCH] Use Gaudi::NamedRange_ equality overload for container comparison. Fixes Moore#300. --- .../include/CombKernel/ParticleCombiner.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h index 043b95a26..b883072e2 100644 --- a/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h +++ b/Phys/ParticleCombiners/include/CombKernel/ParticleCombiner.h @@ -536,14 +536,7 @@ private: if ( decay.children()[IInput].pid() == decay.children()[IInput - 1].pid() ) { // Yes, in this case we should insist that the `IInput`th and // `IInput-1`th inputs were, in fact, the same... - // FIXME(AP): we cannot compare containers because the inputs are Range - // objects which get instantiated when this algorithm's operator() is - // called; the same underlying container passed in N times will result - // in N Range objects with different memory addresses. Instead we use - // the memory address of the first element of the container; this is - // very shaky and we could come up with a better definition of - // 'identical containers' - if ( UNLIKELY( *( std::get<IInput>( inputs ).begin() ) != *( std::get<IInput - 1>( inputs ).begin() ) ) ) { + if ( UNLIKELY( !( std::get<IInput>( inputs ) == std::get<IInput - 1>( inputs ) ) ) ) { throw GaudiException{"Got contiguous children with the same PIDs, but the corresponding algorithm inputs " "were not the same. This is unsupported.", "NBodyCombiner<name>", StatusCode::FAILURE}; -- GitLab