Necessary Maintenance #19476
Workaround for GenVector classes not being constexpr
0%
Description
The geometry vector support infrastructure is designed to take the most possible advantage from constexpr
expressions, including the vectors themselves (for example, Xaxis = { 1.0, 0.0, 0.0 }
).
ROOT GenVector library does not include support for constexpr
vectors, although it does not appear to be any underlying reason.
GCC 6 did a good job in discovering that those vectors could actually be treated as constexpr
even if they were not explicitly supporting that. Clang 5.0 does not.
I have opened a request to support this feature as JIRA 9320. Until that happens, our code must be crippled to remove that support.
Therefore, I have replaced all the instances where constexpr
is giving trouble with GENVECTOR_CONSTEXPR
macro defined in larcoreobj:source:larcoreobj/SimpleTypesAndConstants/geo_vectors.h (larcoreobj:7733b03121641e8e86ff3e4b9c66d512331980c6).
At each ROOT version we adopt, it should be verified that the request is not yet implemented and update the commit above, or finally restore constexpr
.
To make sure we don't forget, each time we update ROOT version the above commit will trigger an error.
Associated revisions
History
#2 Updated by Gianluca Petrillo almost 3 years ago
- Description updated (diff)
#3 Updated by Lynn Garren almost 3 years ago
- Status changed from New to Accepted
Removing constexpr support for vectors (issue #19476)