Skip to content

Don't require equality_comparable in putParameter - #417

Closed
ianna wants to merge 1 commit into
key4hep:mainfrom
ianna:ianna/fix_equality_comparable
Closed

Don't require equality_comparable in putParameter#417
ianna wants to merge 1 commit into
key4hep:mainfrom
ianna:ianna/fix_equality_comparable

Conversation

@ianna

@ianna ianna commented Jul 21, 2026

Copy link
Copy Markdown

Fixes the build against recent EDM4hep, where edm4hep::utils::ParticleIDMeta is no longer std::equality_comparable (its algoType member became private, removing the defaulted operator==). putParameter required that concept only for the *existing == value comparison behind skipIfSameValue().

This relaxes the template constraint and guards the comparison with if constexpr (std::equality_comparable<T>). For non-comparable metadata types the "skip if identical value" shortcut is bypassed; all other behaviour is unchanged.

BEGINRELEASENOTES

  • Fix compilation of putParameter with metadata types that are not std::equality_comparable (e.g. edm4hep::utils::ParticleIDMeta in recent EDM4hep). The skipIfSameValue() optimization is now only applied when the type supports ==.

ENDRELEASENOTES

@ianna

ianna commented Jul 21, 2026

Copy link
Copy Markdown
Author

@jmcarcell and @andresailer - this should allow all tests pass for #372

@jmcarcell

Copy link
Copy Markdown
Member

That has already been fixed in EDM4hep: key4hep/EDM4hep#497 but that change is not in the latest tag/release. The change here would silently ignore anything that doesn't have a operator== defined instead of failing at compile-time.

@jmcarcell jmcarcell closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants