Skip to content

define named constexpr ParticleID instances to be used instead of bare numbers.

Gerhard Raven requested to merge cleanup-particleid into master

Follow up on this comment and tweak ParticleID such than it is constexpr constructible, and thus allow one to make constexpr named instances to avoid having to know numerical values of particles.

Thanks to !4880 (merged) which was merged here, it also defines such a named set for the most popular particles.

In addition, add a few [nodiscard] and make operator<< a hidden friend, so the compiler will no longer mention it in case someone requests a non-existing operator<< as an alternative that it failed to use (ie. make some compiler error messages shorter).

Finally, remove operator!= as C++20 will synthesize it from operator==, i.e. it is no longer explicitly needed.

Edited by Gerhard Raven

Merge request reports

Loading