Convert bit calculation to constexpr, avoid casts.

Reference issue

What does this implement/fix?

This is a simple patch, which changes enums to static constexpr int in evaluation of floating point bit sizes. The advantage of this is that a few casts can be removed. static constexpr int is quite a mouthful, so I chose to not repeat it for every single variable.

Additional information

I was looking more globally at replacing enums in traits with constexpr, mainly to not have to cast to int all the time when comparing the dimensions of matrices but that is a larger project of which I could make this little spin-off.

I ran most of the testsuite, in particular the packetmath tests with no errors.

Edited by Tobias Schlüter

Merge request reports

Loading