Open JohelEGP opened 6 years ago
looks like an oversight when I added those operators. The dimensional analysis should all be constexpr, but if you find holes obviously let me know.
The cmath functions, aside from specialized pow/sqrt, are not constexpr, because right now they are ADL wrappers on top of the actual cmath functions, which are not constexpr as of c++17. I've been looking for a good constexpr cmath library to pull in, but haven't settled on anything yet.
Greetings.
I tried using some units in a
constexpr
context and found thatconstexpr
is partially supported. Here's an extract of what I tried to run, with the operations that lackconstexpr
support commented out.I tested this on the branch v3.x. The library uses C++17 in some places, so I suggest improving the
constexpr
support, which should be doable even with C++14. I did check some of the operation's implementations, and sprinklingconstexpr
should do the job. I didn't check the support for the dimensional-analysis operators nor the cmath's-like operations.