mp-units/latest/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/ #800
Replies: 1 comment 16 replies
|
I see another benefit of doing it this way: we also simplify external users of the code. For example, I am using Eigen as a raw linear algebra library and wrap it up in classes that incorporates mp-units in an attempt to achieve type-safety. For example, a 'GaussianRandomVariable' is by itself a vector of means and a covariance matrix. Adding unit-safety for this does mean when I incorporate Eigen that I essentially have to create a 'GaussianRandomQuantity' and a 'GaussianRandomQuantityPoint' that are my analogues to 'mp_units::quantity' and 'mp_units::quantity_point'. Having the 'point-vs-delta' inside the reference itself would potentially slash the number of classes needed by the user in half. |
16 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
mp-units/latest/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/
The quantities and units library for C++
https://mpusz.github.io/mp-units/latest/blog/2025/01/15/bringing-quantity-safety-to-the-next-level/?h=
All reactions