A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience.
These have been constexpr compatible since C++14. Mechanically, the
way I did this was:
Find an overload that was not constexpr.
Make a test that requires it to be constexpr to pass (either
tweaking an existing test, or making a new one).
Make sure the test fails.
Change the function until the test passes.
The biggest challenge was that our default compiler wouldn't accept our
lambda in a constexpr context. That feels like a bug, but in any
case, we were able to work around it by making a manual function object
with an explicitly constexpr call operator.
These have been
constexpr
compatible since C++14. Mechanically, the way I did this was:constexpr
.constexpr
to pass (either tweaking an existing test, or making a new one).The biggest challenge was that our default compiler wouldn't accept our lambda in a
constexpr
context. That feels like a bug, but in any case, we were able to work around it by making a manual function object with an explicitlyconstexpr
call operator.Fixes #244.